Skip to main content

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.

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.


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


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.


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


Reply