AnsweredAssumed Answered

Creating a custom ID field with padded zeros

Question asked by artigr on Jul 28, 2016

Hello all,

 

I am looking for a way to leverage the ID field in a SharePoint list to come up with a customized ID field relevant to the user.

For e.g.,

If the item ID is 29, the user wants to see "2016/00029/US".

My thought was, I could create a Nintex workflow to execute when the item is first created, and use the fn-PadLeft inline function to construct the '00029' string and combine it with the other text snippets.

Unfortunately, I'm not able to use the PadLeft function in the "Set Workflow Variable" or "Update List Item" functions - see below for why.

 

The formula

  1. The formula for the PadLeft inline function is fn-PadLeft(string to pad, desired total length, [optional padding character]) according to the Inline functions provided page. In my case, this would translate to fn-PadLeft({Current Item:ID},5,0).
  2. I've added a 'set workflow variable' action, and written in most of the formula:
    scr1.PNG
  3. At this stage, when I double-click the ID field from the right panel to insert it where the cursor is in the above image, it does this strange thing where the variable jumps across to the right, completely reversing the formula. I can't move the ID field to the left, or delete to the left and start over since the ID field refuses to remain in the left.
    scr2.PNG

I am completely confused as to why this field won't let me use an inline function, or if it does, what I'm doing wrong because it seemed fairly straightforward with the existing formula.

Any thoughts / suggestions?

Outcomes