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 / Generate auto incremen...
Power Automate
Unanswered

Generate auto increment sequence number in Power automate for a SharePoint column

(0) ShareShare
ReportReport
Posted on by 531

I have a ItemNum column in SharePoint list. I need to autogenerate ItemNum in the sequence 1000, 1001, 1002, 1003, etc.

 

For this, I have a initialized a variable SeqNum, autoincrementing it by 1 and assigning it to SharePoint column. But the auto increment doesnt work. Any idea where I am going wrong? Below is the screenshot for the same.

 

Iantaylor2050_0-1680963121577.png

 

Iantaylor2050_1-1680963268945.png

 

Iantaylor2050_2-1680963285900.png

 

 

 

 

 

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    Are you creating a lot of items within a loop, or do you want to create individual items periodically?

     

    If you wanted to ensure you get the next sequence, you can use Get items set to Top Count of 1 and sort by ItemNum in Descending order. This will return the largest ItemNum in your list. You can then add 1 to the number and use that value as your next ItemNum for the item you are creating.

  • Iantaylor2050 Profile Picture
    531 on at

    Hi @grantjenkins 

     

    I am creating individual items periodically

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Hopefully this is what you're looking for.

     

    For this example, I have the following list with no items (empty list). Note that Item No is of type Number with internal name ItemNo.

    grantjenkins_0-1680999218526.png

    See full flow below. I'll go into each of the actions.

    grantjenkins_1-1680999264033.png

     

    I'm not sure what your trigger is, so I've just used a Manual trigger with a Text input called Title that I'll use to populate the Title field.

    grantjenkins_2-1680999315983.png

     

    Get items retrieves the item with the largest Item No in the list. Note that it has Order By set to ItemNo desc and Top Count set to 1.

    grantjenkins_3-1680999391783.png

     

    Create item uses the Title we entered in our Manual trigger for the Title, and the following expression to calculate the next Item No. If we look at the expression from the inside out, we get the first item returned and get the Item No. If no item returned (no items currently in the list) we will default the initial value to 999 using coalesce. We then convert that to an int, then add 1 to it. So the first item will be 999 + 1. The second item will be 1000 + 1, etc.

    add(int(coalesce(first(outputs('Get_items')?['body/value'])?['ItemNo'], 999)), 1)

    grantjenkins_4-1680999549676.png

     

    After running the flow a few times, passing in a Title each time, we would get the following results.

    grantjenkins_5-1680999768026.png

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard