cancel
Showing results for 
Search instead for 
Did you mean: 
randy826
Nintex Newbie

Convert a number to string in workflow 2010

Jump to solution

Question: How do i convert a number into a string so I can pad it with zeros and append it to an alpha value?

Background: I am creating a workflow to create a sequence number to track requests.  The sequence number will have an alpha code + current year + a three digit incremental sequence number. (i.e., "aa17001").  When a new request is added, it is given an alpha code based on the requester department, and the sequence counts up from 1 to 999.  The problem is the sequence is numeric (in order to be incremented), and I need to pad low numbers with zeros to get the right character length, and then I need to append it to the alpha code.  for example, sequence '2' needs to be padded with zeros to become '002', and appended to the alpha code and year to end up as a string 'aa17002'. A sequence number 14  might end up in the sequence string as 'cb18014'.

I have searched through Nintex workflow functions, but there is no 'fn-toString()' function available, and I can't find anything in the discussions.

0 Kudos
Reply
5 Replies
richardlhughes
Nintex Newbie

Re: Convert a number to string in workflow 2010

Jump to solution

I would use the Build String action to accomplish this item. You should be able to accomplish the concatenating of the 3 parts of your string with this action.

Reply
Automation Master
Automation Master

Re: Convert a number to string in workflow 2010

Jump to solution

there are  PadLeft() and PadRight() inline functions that should do the job

Reply
sojanm
Nintex Newbie

Re: Convert a number to string in workflow 2010

Jump to solution

You can use this formula

AAfn-FormatDate(Current Date,"yy")fn-PadLeft(ID,3,"0")

In place of AA use your department variable, and in place if ID user your sequence number.

Reply
jpmhuls
Nintex Newbie

Re: Convert a number to string in workflow 2010

Jump to solution

For the sequence number you could also count from 1000-1999 and use fn-SubString to take the left 3 positions.

Reply
Not applicable

Re: Convert a number to string in workflow 2010

Jump to solution

Hi, ‌, did any of the replies in this thread work out for you? We'd love to hear. And if one did, please mark it correct as that's helpful to other community members who search for similar answers. Thanks!

0 Kudos
Reply