cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Julien2
Post Prodigy
Post Prodigy

Autogenerate a string code based on letters

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.

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

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.

View solution in original post

2 REPLIES 2
v-litu-msft
Community Support
Community Support

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.

View solution in original post

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!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,262)