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 / Add custom prefix to u...
Power Automate
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!

Categories:
I have the same question (0)
  • Verified answer
    DeepakS Profile Picture
    2,301 Most Valuable Professional on at

    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.

     

     

     

  • CarlHRVA Profile Picture
    601 on at

    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

     
  • DeepakS Profile Picture
    2,301 Most Valuable Professional on at

    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

    @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']')

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 259 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 177 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 136 Super User 2026 Season 2

Last 30 days Overall leaderboard