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 / Autogenerate a string ...
Power Automate
Answered

Autogenerate a string code based on letters

(0) ShareShare
ReportReport
Posted on by 1,712

Hello Experts,

I am trying to build a flow that autogenerates an incremental string code as per the last code used.

For example:

Let's say I have a record with a code RAA, then the next code that should be generated for the new record is RAB and after RAC -> RAD.. so on until it reaches RZZ.

If the last code is RZZ then the generated string code should start with S Series that means SAA, SAB ->SAZ.. SAZ, SBZ, SCZ ->SZZ.

So the logic is first to check on the last character what was the letter and what's coming after it.

Secondly, when the last character is Z the flow should start to check on the second character and apply the same logic as the first one.

Finally, when the last and second characters are ZZ it should start with another series.

Here is a screenshot of what I was trying to do but still struggling:
Capture.PNG


Can someone please explain it in detail and provide me examples to help me achieve this scenario?

Any help will be greatly appreciated.

Categories:
I have the same question (0)
  • Verified answer
    v-litu-msft Profile Picture
    Microsoft Employee on at

    Hi @Julien2,

     

    I create a Flow could approach what you want, I export it as a zip file, you could download it and import into your Flows:

    Screenshot 2021-02-08 143726.jpg

     

    Run result:

    Screenshot 2021-02-08 143749.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • EBMRay Profile Picture
    1,712 on at

    Hello @v-litu-msft ,

    Thanks a lot for providing the flow solution, I really appreciate it.

    I just modified in the "condition 2" the "set variable 2" by changing the letter A after the compose concatenation to Z, because when it's RAZ it should not be RAA again it should be RBZ->RZZ and it starts with the new series.

    Finally, I am trying to check if this is the first record created in the entity, the variable should be static with RAA then automatically the flow check for the last generated code record and increment the string.

    Please correct me if am wrong, I am thinking to add a list record action to populate all the records and check if there is an RAA assigned to a record if so, then it will go ahead update the record with the next code, else the code will be RAA because it is the first record.

    Looking forward to your response,

    Thanks again!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 523

#2
Valantis Profile Picture

Valantis 318

#3
David_MA Profile Picture

David_MA 235 Super User 2026 Season 1

Last 30 days Overall leaderboard