web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get unique integer in ...
Power Automate
Suggested Answer

Get unique integer in Power Automate cloud flow

(0) ShareShare
ReportReport
Posted on by 28
Hi All,
 
My cloud flow is accessed by multiple users, and it generates an integer (e.g., 1, 2...100, etc.) with each execution. Each flow instance needs to produce a unique integer. Currently, the integer is stored in an Excel Online sheet, which the flow accesses and increments by one, allowing subsequent flows to retrieve the next unique integer. This setup helps avoid duplicates under normal conditions.

However, if multiple users trigger the flow simultaneously, some flows end up generating duplicate integers. This happens because they are fetching the same integer from Excel Online before it is incremented by an another flow.

Could you suggest a solution? I'm open to saving the integer in a different source, as long as it doesn’t require a premium license. Also if possible, good to have flows generating sequential integers rather than random ones.

Thanks,
Kapil  
Categories:
I have the same question (0)
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    You could use current date with hour, minutes, seconds and milliseconds. That should be safe way since I don't think people will start the flow at the same millisecond.
     

     
    Result:

     
    If it doesn't need to be integer but could also be just string then use Guid() -expression which generates globally unique string.
    Or you could use FlowRunId. Expression: workflow()['run']['name']. Then it would always be different id (string).
  • Kapil775 Profile Picture
    28 on at
    Currently the integer returned by my flow is of three digits. Business wants the flow to return an integer having maximum of four digits. Anything beyond that might break their process.
  • Suggested answer
    eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at
    Then I would suggest using sharepoint list where you store those integer Id's since Excel can be bit slow to sync.
     
    Or maybe you could make an extra flow that checks every hour that there aren't duplicates and if there are then increase the duplicate int id (and if there are rows after that then increase their int ids as well)

     Note that since you only have four digits available then you will have only 9999 before the list needs to be cleared so hopefully they are just temporary id's and don't need to be stored for too long.
     
  • Chriddle Profile Picture
    8,443 Super User 2025 Season 2 on at
    If your "Integer" is just a synonym for "ID", check the guid() function.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard