Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Add custom prefix to unique ID

(0) ShareShare
ReportReport
Posted on by 601

Hello, 

 

I am trying to create a custom ID with a text prefix before it anytime a new item is created. I have a large list that we've been using in a 2013 environment with the last ID created being 176,420.  Since I know that the 176,240 is the last ID created in our old environment, I'd like the flow to create a new unique ID( whenever a new item is submitted) in increments of one, starting with 176,241. The format of the ID would be as follows: "OTC-US-2020-176421". Any help is greatly appreciated and if any of this did not make sense please let me know and I will try to better clarify.

 

Thank you!

  • CarlHRVA Profile Picture
    601 on at
    Re: Add custom prefix to unique ID

    @DeepakS I looked closer at my list and what I needed was really close to your answer! Since I brought the list over with ShareGate the ID's still match up with items . I just needed to add the ID onto the end of the formula you provided. Thank you so much for your help!  The formula I'm using is:

     

    concat('OTC-','US-','2020','-','triggerBody()?['ID']')
  • DeepakS Profile Picture
    2,301 Most Valuable Professional on at
    Re: Add custom prefix to unique ID

    Hi @CarlHRVA 

     

    Yes, set the default value to 176241.
    I think I misread your question, I thought you are looping through each item, but it seems you want on item add.
    For this You may need to query your list and get the total items count and add that number to 176241.

     

    ——————————————————
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

     

     

     

  • CarlHRVA Profile Picture
    601 on at
    Re: Add custom prefix to unique ID

    Thanks for replying, @DeepakS ! When you say "initiate it with 176241", do you mean set the default value of the Variable to that? Also, I'm a bit confused how this will add 1 to the ID each new item. Should I be using an increment variable like the below or does the formula do that already somehow?

     

    Here is what my variable looks like:

     

    Capture.PNGCapture.PNGCapture.PNG

     
  • Verified answer
    DeepakS Profile Picture
    2,301 Most Valuable Professional on at
    Re: Add custom prefix to unique ID

    Hi @CarlHRVA 

     

    You can create an integer variable counter and initiate it with 176421.

    following expression will help you creating unique ID:

    concat('OTC-','US-','2020','-',variables('Counter')) 

     

    ——————————————————
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

     

     

     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1