web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Struggling with adding...
Power Automate
Unanswered

Struggling with adding custom prefix in Lists that counts upwards with each entry

(0) ShareShare
ReportReport
Posted on by 6

Hi,

 

I'm brand new to Power Automate, struggling with what I imagine is quite a basic solution regarding custom prefixes on unique IDs in Microsoft Lists.

 

Our company holds a spreadsheet where we pick the next number for each new project - for example latest is Q21567. We are replacing this system with Microsoft Lists and using lists to generate the next number in the sequence using a unique ID. We'd like to continue on in the same sequence to minimise any unnecessary messing around in our file server etc.

 

Can anyone show me step by step how I might accomplish this? It's frying my brain as a newbie.

 

Any help is very much appreciated.

 

Jonathan

Categories:
I have the same question (1)
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at

    SharePoint (aka Microsoft Lists) has a built-in column named ID that you can use to generate the unique IDs. The ID column in SharePoint is the primary key and always begins at 1 and can only be used one time. Once you know the last item in your existing spreadsheet, you can use an expression to increment the SharePoint ID by the last value in your Excel spreadsheet. You would use this expression based on your example above:

    add(triggerOutputs()?['body/ID'],21567)

    For whatever field you want to populate this into, just manually add the Q. For example:

    David_MA_0-1704219797316.png

    If this ran on the item in SharePoint with the ID of 1, it would return Q21568.

  • jc89 Profile Picture
    6 on at

    Hi there David_MA, thanks a lot for your help.

    I did what you mentioned, and have been returned the following error message.

    jc89_1-1704272548688.png

     

    Would you know how I should correct this? I tried to change the variable type to string without really knowing what I'm doing but have the same issue.

     

    If it helps, which I'm not sure it does... my test data looks like this after trying.

    jc89_2-1704272955430.png

     



  • jc89 Profile Picture
    6 on at

    Also my flow setup looks like this

    jc89_3-1704273167350.png

     

  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at

    What expression are you using to populate the field? It would be impossible for the ID field in the SharePoint list to be null as it is a system field and is required.

  • jc89 Profile Picture
    6 on at

    I put it in exactly as you'd written it, hopefully this picture shows 

    jc89_0-1704288611430.png

     

  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at

    Very odd. I duplicated what you did and do not get any errors. Is your Q Number field a string? If not, change it to a string since you are prefixing it with Q. That's the only thing I can think of at the moment unless there is some other field that you are updating with an add expression.

    David_MA_0-1704290898130.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard