
Announcements
Hi All,
We have list name "Location Data Entry", and column "Location Request ID" which need to generate auto ID incremental of puls 1 when new items submitted on PowerApps.
There is lookup column name "Location Data". Data as below
Title Value
India IN
South Africa SA
England EN
West Indies WI
Now When user submit item on "Location Data Entry" and selected "South Africa" from lookup column. In this, "Location Request ID" need to generate as "SA-001". Incase if "SA-001" is already exist on the SP list means, it need to generate as "SA-002" like.
Similar way, if user select "India", then "Location Request ID" need to generate as "IN-001" only not like "IN-003".
Please guide us, how to update patch function on the submit button. If any related links or related videos please share with us. Your suggestions are highly appreciated.
Hi @Muralibk_sp
I do not know what back end you are using as you didn't mention, but I would really recommend that you do not do this in the Canvas App. The reason is, that there is no way to be sure that another user isn't doing the same thing at the same time.
If they are, in your example, you have India, SP-001 that is there.
Two people are working and want to submit. They submit and read SP-001, both of them would then write SP-002 and you would have duplicates.
If you are going to do this, I would recommend using Power Automate. For the trigger, under settings, turn on Concurrency and then set it to 1. This way only 1 instance of the Flow will run at a time.
Now the issue of course is that you may have many people, who are NOT causing race conditions.
So you could
1. Create a Parent Flow and do NOT set the Concurrency
2. Create child flows for each Country that you expect to generate numbers of
3. Set THOSE to have Concurrency On and set to 1
You can do searching, as there are plenty of people who have asked this and many different answers.
If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others
Cheers
Thank You
Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
https://gernaeysoftware.com
LinkedIn: https://www.linkedin.com/in/michaelgernaey