Auto generate custom ID with Prefix

Copper Contributor

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:

LaxmikantB2_0-1629297689424.png

 


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.

2 Replies
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?
can you explain the function little bit more...like how to implement it...