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 / Unique ID like 2019-01...
Power Automate
Answered

Unique ID like 2019-01 with condition don't count other line items

(0) ShareShare
ReportReport
Posted on by 179

I have a flow that creates a unique ID with the year 'yyyy' format, like 2019-01.

As last step, I entered the condition, that a column of my list has to contain a specific word.

The problem is that it then looks like this. After 2019-34 comes 2019-38. What I would like to have, is that after 2019-34 comes 2019-35.

 

074.JPG

 

 

 

Categories:
I have the same question (0)
  • Dricc Profile Picture
    179 on at

    My flow looks like this. I don't know if it helps.

     

    083.JPG

  • ErichH Profile Picture
    322 on at

    Are you sorting the data in the “get items” step by “ID”?

     

    and 

     

    Why is the “increment variable” step outside of the loop “apply to each”? What is inside of the loop?

  • Dricc Profile Picture
    179 on at

    Thank you @ErichH !

    Please find my flow below. Does it help?

     

    084.JPG085.JPG086.JPG087.JPG

  • ErichH Profile Picture
    322 on at

    you have to

    > move the "increment variable" step into the "apply to each" loop as you want to have unique numbers.

     

    and 

     

    suggest to add in "Get items" in 

    > "order by" the dynamic variable ID .

    > "filter by" the text  generated%20number ne  ''

     

  • Dricc Profile Picture
    179 on at

    Thanks a lot @ErichH !

    just one question: what does this do and what is the dynamic variable exactly:

    "order by" the dynamic variable ID

     

    Also, the flow runs succesfully, but doesn't do what I want:

     

     

    088.JPG089.JPG090.JPG091.JPG

  • Verified answer
    RobElliott Profile Picture
    10,323 Super User 2025 Season 2 on at

    Hi @Dricc, forgive me for stepping into your conversation with @ErichH  but I have an alternative method in the images below which I hope you will find is a solution. The main thing is that whenever I deal with incrementing values I always save the inext value to be used, i.e the 35 you mentioned in yur first post, in a separate SharePoint list which only has that 1 item. The flow gets that number, updates the new item with it then then adds 1 to it at the end of the flow ready for the next item that meets the Condition.

    In my example the Condition must be that Current is equal to Yes.

    Image 5: as the number has been used in a string variable we need to convert it back to an integer ready to be saved to the increment list.

    If the Condition evaluates to No then the number is not increased by 1, You can see this in the last image.

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

     

    1-Trigger - get item1-Trigger - get item2-Compose Year Init variable2-Compose Year Init variable3-Get increment value to be used3-Get increment value to be used4-Condition and update item4-Condition and update item5-Convert to integer5-Convert to integer6-add 1 to the increment value6-add 1 to the increment value7-Next increment value to be used if condition is yes7-Next increment value to be used if condition is yes8-Current list with generated values8-Current list with generated values

     

     

     

  • Dricc Profile Picture
    179 on at

    Thank you @RobElliott !

    That looks pretty good exept for the last part where the sister list is updated. I get following error:

     

    092.JPG093.JPG

     

  • RobElliott Profile Picture
    10,323 Super User 2025 Season 2 on at

    The error message says the item doesn't exist. You must already have an item in that list.

    Rob
    Los Gallardos

  • Dricc Profile Picture
    179 on at

    @RobElliott, I do have an item in my list:

     

    094.JPG095.JPG

  • RobElliott Profile Picture
    10,323 Super User 2025 Season 2 on at

    Could you post of screenshot of the Update item action that failed so we can what the issue might be in it.

    Rob
    Los Gallardos

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