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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating a unique ID b...
Power Automate
Unanswered

Creating a unique ID building off of the response ID.

(0) ShareShare
ReportReport
Posted on by 88

I'm trying to create a unique ID easily using the response ID.  I want the numbers to go up by 1 each time a new entry is added to my List.  I would like it in the format of 2021-1011, 2021-1012, etc.  

 

The way I have it set up now gives me that except when it hits  2021-1099 the next one will jump to 2021-10100 instead of 2021-1100 like I would prefer it to do.

 

Is there an easy way to make that happen by adding a simple formula within this cell??  Below is the picture of the flow I have started.

 

Thank you in advance for your help.

 

ID.gif

 

Categories:
  • jinivthakkar Profile Picture
    4,187 on at

    @SLBMetrology I think you are using SharePoint list, so I would advise you to have a list which holds your counter value.

    My list

    jinivthakkar_1-1612720429795.png

     

    My flow

    jinivthakkar_0-1612720388785.png

    When your flow gets trigger, first get the counter value and use counter as required

    jinivthakkar_2-1612720493423.png

    Increment the counter and update the counter value 

    jinivthakkar_3-1612720578717.png

     

    I ran the flow, counter value after first run and keeps on increasing

    jinivthakkar_4-1612720627514.png

    add(int(outputs('Get_item')?['body/Title']),1) /* adds 1 to string value from Get list item action */

    Keeping a track of the count and having the logic to get the current count and then update it in the flow is not the best approach.

     

    Hope my idea helps.

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

     

  • tom_riha Profile Picture
    10,187 Most Valuable Professional on at

    Hello @SLBMetrology ,

    I'd build the unique ID before the 'Create item' action in a variable and then use the variable instead.

    1. Intialize a string variable
    2. Add a condition to check if the 'Response Id' is less than 100
      1. If it's less than 100, store 10[Response Id] into the variable
      2. If it's more than 100, store 1[Response Id] into the variable
    3. Use the variable in the 'Create item' action: formatDateTime(...)-[variable]

    image.png

  • jinivthakkar Profile Picture
    4,187 on at

    @tom_riha this is good solution as long as the response ID doesn't exceed 999.

     

    And we would have to keep adding the conditions every time the response changes from 999 to 1000 and then again 9999 to 10000 and so on and handling this would bring a switch case or something which will check if response ID is less than 100 or greater than 100 but less then 1000 and so so, it will keep adding it up making it more and more complex for no reason.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 330

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 123

Last 30 days Overall leaderboard