Forum Discussion

LaxmikantB2's avatar
LaxmikantB2
Copper Contributor
Aug 18, 2021

Auto generate custom ID with Prefix

WE have our default ID field in SP list. I want to use that field to create my own custom ID started with some text prefix with 0000 added to the default ID.For ex- ODR0001..ODR0002...ODR0010...ODR0099...ODR0100...ODR1001....I created a WF having below steps:

 


It working fine till two digit ID. But the only thing I am not sure about that for 100th item will it be ODR0100 or ODR00100. If I will get ODR00100 then how to get correct one which will be ODR0100. Thanks in advance.

  • jefmeyer's avatar
    jefmeyer
    Iron Contributor
    I would create a couple variables, then get the length of the ID (use length function), then using the length of the ID, pad function to prefix the ID with zeros, and then append you ODR string. What will happen when the ID reaches 10,000?
    • LaxmikantB2's avatar
      LaxmikantB2
      Copper Contributor
      can you explain the function little bit more...like how to implement it...

Resources