0

Auto Increment ID using Flow correctly 2 hours ago

Hi All,

I have a list with bunch of columns but one column is ID Number which will have custom id RP1-001, RP1-002 like so on so forth, i have 121 records, i have loaded them in the list so last record ID number is RP1-121 and SharePoint list item id is 121. The question i have is how can i use flow to auto increment this id every item when a new item is created? and how to check if an item is deleted, it should increment accordingly, like if an item is added the ID number is RP1-122 and list item id is 122 and lets say someone deleted it, the next item item is added it should be RP-123 , because list item would be incremented automatically to 123, can we do that kind of checks in MS flow? and the whole idea of linking ID Number to out of the box list item id is the right way of approach? please let me know.

1 Answer 1

1

Answer to your first part

The question i have is how can i use flow to auto increment this id every item when a new item is created

When Item is created, run the flow. That flow can get the ID of that item created. Once you have the ID ( example 23 )of that item created , you can update the custom ID to that ID RP1-23.

Answer to your 2nd part

the whole idea of linking ID Number to out of the box list item id is the right way of approach

Yes this approach is usually used to generate the Reference number to that item for end users. Example you want to have year concatenating to the ID for end users.

However, approach to delete and then update that custom ID is not correct.

Suppose customerA submitted a request and he has custom id as RP1-34 ,
customerB submitted a request and he has custom id as RP1-35 ,
customerC submitted a request and he has custom id as RP1-36 ,
 customerD submitted a request and he has custom id as RP1-37 

Now if someone ( suppose admin) delete RP1-35, and you try to update the reference numbers , then customerC submitted the request would be having id as RP1-35 and customerD would be having customID as RP1-36. This will cause issues.

How to update the custom ID via flow

  1. Add flow on Item created
  2. add action Update item
  3. Set the custom Item enter image description here
6
  • My bad, i shouldve put this most clearly, those RP1-ID should be autogenerated when new item is added, so i am trying to figure out the logic where item is updated accordingly
    – biggie
    Sep 20, 2021 at 23:45
  • Still it is not clear what exactly you want to do? Do you want to know how RP1-ID can be done in flow ?
    – Saira
    Sep 20, 2021 at 23:49
  • I have already loaded the items , in my dev environment, i have loaded 6 items the 6th item Custom ID is RP1-006. Now if i add a new item its custom ID number should become RP1-007 and after RP-009 it should become RP-010 and so on, it should be updated when a new item is created. and ya trying to do in flow
    – biggie
    Sep 20, 2021 at 23:53
  • 1. Add flow on Item Created 2. Use action UpdateItem and in ID pass the ID of the current Item. 3. Set CustomID to string variable "RP1-" ID
    – Saira
    Sep 21, 2021 at 0:19
  • See the answer above, I have updated the answer with image
    – Saira
    Sep 21, 2021 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.