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 / Generate Custom ID for...
Power Automate
Answered

Generate Custom ID for SharePoint Using MS PowerAutomate

(0) ShareShare
ReportReport
Posted on by 2

Hello,

 

I know that this question is asked several times. But i have a slightly different requirement.

 

I wanted to generate a custom ID using Flow, when a new item is created in a SharePoint list. The Custom ID will be written in a SharePoint Column.

 

The Requirement is like as below:

1. There will be a prefix of ABCDEF then 0000 and then the default ID

2. If the ID is 1 then the Custom ID should be ABCDEF00001

3. If the ID is 212 then the Custome ID Should be ABCDEF00212

 

Can anyone please help that how to achieve this?

 

Regards,

Categories:
  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    Hi @AkshayManke 

     

    Perhaps you might want to create a condition and check it the number is less than 99,

     

    YES - 

    concat('ABCDEF0000',outputs('Get_file_properties')?['body/ID'])
     
    NO-
    concat('ABCDEF000',outputs('Get_file_properties')?['body/ID'])
     
    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
     
     
     
  • AkshayManke Profile Picture
    2 on at

    Hello @CFernandes,

     

    Thanks for the quick reply. However i am unable to corelate the expression with my SP List. Can you please share more details like what i need to add and where? You have given the right example and I tried that using a condition but somehow not getting the desired results and failing at the expression. 

     

    Below my Details:

    SharePoint List Column: ID

    Prefix to be Added as Below:

    Till 99 = ABCDEF000099

    Till 999 = ABCDRF000999

    Till 9999 =ABCDEF009999

    Till 99999 = ABCDEF099999

     

    Many Thanks in advance.

     

    Regards,

  • CFernandes Profile Picture
    8,504 Most Valuable Professional on at

    @AkshayManke  I think you might have to nest conditions(use Multiple conditions) in the Power Automate. 

     

    Check if less than 99 

    Check if it less that 999......

     

    CFernandes_0-1600347994550.png

     

    I cannot think of a better idea, right now with reference to your scenario(Perhaps our community members might have better ideas)

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

     

  • ScottShearer Profile Picture
    25,331 Most Valuable Professional on at

    @AkshayManke 

    Please take a look at my solution below.  I could have made it with fewer actions but did it the way I did for clarity.

    I have a separate SharePoint list where I store the next ID number that I'll be using and that list has only one row. 

    The issue you are having is that Power Automate does not have an expression that allows you to take a certain number of characters from the right side of a string.  I work around that by using the skip() expression.

    Please let me know if you have any questions.

    ID1.jpgID2.jpgID3.jpgID4.jpgID5.jpgID6.jpg

     

     

  • Verified answer
    AkshayManke Profile Picture
    2 on at

    Hello @CFernandes & @ScottShearer,

     

    I got the solution in the below link.

    https://powerusers.microsoft.com/t5/Building-Flows/format-a-string-with-leading-zeros-in-MS-Flow/td-p/213310 

     

    I used formatNumber expression and got the custom ID for the list items. However many thanks to both of you for your help and guidance on the request.

     

    Regards,

    Akshay

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard