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 Apps / Auto generate custom I...
Power Apps
Answered

Auto generate custom ID with Prefix

(0) ShareShare
ReportReport
Posted on by 44

WE have our default ID field in SP list. I want to use that field to create my own custom ID started with some text prefix with 0000 added to the default ID.For ex- ODR0001..ODR0002...ODR0010...ODR0099...ODR0100...ODR1001....I created a WF having below steps:

Laxmikant_0-1629297394173.png

It working fine till two digit ID. But the only thing I am not sure about that for 100th item will it be ODR0100 or ODR00100. If I will get ODR00100 then how to get correct one which will be ODR0100. Thanks in advance.

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Hey

    It will be ODR00100

    What you can do is, before, inicialize a var. Empty. Than, if Id < 100, Set var to ODR00ID, else, SET VAR TO ODER0ID

     

    Than, when you Update Item, set the ID to that var

  • Laxmikant Profile Picture
    44 on at

    Thanks for responding but what will happen after once id will be 1000?How to handle that?

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Switch case then

    Id < 100 -> ORD00, 100 =< ID =< 1000 -> ORD0, ID >= 1000 -> ORD

  • Verified answer
    Laxmikant Profile Picture
    44 on at

    I never used switch case. Am I doing right?

    Laxmikant_0-1629300280758.png

     

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    My mistake... No. Switch will not work

     

    Use this

     

    Nogueira1306_0-1629301864601.png

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard