Easiest way to add an Incrementing ID column on lists?

%3CLINGO-SUB%20id%3D%22lingo-sub-1421100%22%20slang%3D%22en-US%22%3EEasiest%20way%20to%20add%20an%20Incrementing%20ID%20column%20on%20lists%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1421100%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20what's%20the%20easiest%2Fcleanest%20way%20to%20add%20a%20custom%20incrementing%20ID%20column%20to%20a%20list%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eive%20created%20a%20list%20to%20manage%20customer%20information%20and%20if%20possible%20would%20like%20a%20customer%20ID%20column%3C%2FP%3E%3CP%3EEx%20CUST10001%2C%20CUST10002%20%26amp%3B%20also%20be%20able%20to%20start%20the%20number%20sequence%20at%2010000%20instead%20of%201...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eis%20this%20possible%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKind%20rgds%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1421100%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1421259%22%20slang%3D%22en-US%22%3ERe%3A%20Easiest%20way%20to%20add%20an%20Incrementing%20ID%20column%20on%20lists%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1421259%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F98375%22%20target%3D%22_blank%22%3E%40Charlie%20Jones%3C%2FA%3E%2C%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20way%20is%20to%20user%20PowerAutomate.%20You%20could%20create%20another%20list%20with%20one%20item%20that%20contains%20the%20next%20ID%20to%20use%3A%20ex%3A%201000.%3C%2FP%3E%3CP%3EThen%20when%20a%20new%20customer%20is%20created%2C%20you%20will%20have%20a%20flow%20that%20will%20be%20triggered%2C%20it%20will%20look%20at%20the%20ID%20in%20the%20other%20list%20and%20generate%20the%20Customer%20ID.%20You%20will%20update%20the%20customer%20items%20and%20then%20increment%20the%20ID%20in%20the%20other%20list.%3C%2FP%3E%3CP%3ESo%20when%20someone%20will%20create%20a%20new%20customer%2C%20they%20will%20only%20see%20the%20Customer%20ID%20after%20it%20is%20created%20when%20the%20flow%20will%20execute.%3C%2FP%3E%3CP%3ETo%20avoid%20concurrency%20issue%20(someone%20else%20create%20a%20new%20customer%20at%20the%20the%20time%20your%20flow%20get%20the%20ID%20and%20increment%20it)%2C%20you%20could%20implement%20a%20lock%20mecanism%20in%20the%20list%20that%20contains%20the%20ID%20but%20maybe%20this%20is%20not%20relevant%20in%20your%20case.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20other%20way%20is%20to%20use%20a%20remote%20event%20receivers%20instead%20of%20PowerAutomate%20that%20provides%20more%20flexibility%20but%20need%20some%20skills%20with%20the%20concept.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi what's the easiest/cleanest way to add a custom incrementing ID column to a list?

 

ive created a list to manage customer information and if possible would like a customer ID column

Ex CUST10001, CUST10002 & also be able to start the number sequence at 10000 instead of 1...

 

is this possible?

 

Kind rgds

1 Reply

@Charlie Jones

One way is to user PowerAutomate. You could create another list with one item that contains the next ID to use: ex: 1000.

Then when a new customer is created, you will have a flow that will be triggered, it will look at the ID in the other list and generate the Customer ID. You will update the customer items and then increment the ID in the other list.

So when someone will create a new customer, they will only see the Customer ID after it is created when the flow will execute.

To avoid concurrency issue (someone else create a new customer at the the time your flow get the ID and increment it), you could implement a lock mecanism in the list that contains the ID but maybe this is not relevant in your case.

 

The other way is to use a remote event receivers instead of PowerAutomate that provides more flexibility but need some skills with the concept.