Convert a number to string in workflow 2010

  • 30 March 2017
  • 4 replies
  • 13 views

Badge +1

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.


4 replies

Badge +3

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.

Userlevel 5
Badge +14

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

Badge +10

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.

Userlevel 2
Badge +11

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

Reply