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 Apps / Autonumber prefix base...
Power Apps
Unanswered

Autonumber prefix based on Choice column

(0) ShareShare
ReportReport
Posted on by 27

Is there any way to determine the prefix in an Autonumber column based on the value in a second, choice column. I want to automatically assign sample reference codes, but distinguish between which of three groups generated the sample.

 

The group is selected in a choice column, and I would like a prefix to be set to the front of the autnumber field. For example, if the groups are A, B and C, the sample code should be something like "A-100", "A-101", "B-102" etc.

 

Ideally each would have their own sequence, but this is less important. I know I can organise this through a second calculated column, but wondered if there's a on-stop solution for it instead?

I have the same question (0)
  • Verified answer
    Hamish Sheild Profile Picture
    3,005 Most Valuable Professional on at

    Hi @krp28 

     

    I am pretty sure that there isn’t a way to solve this within a single field. I have done something similar before and I needed to use 3 fields to achieve this...

     

    1. An auto number filed

    2. The choice field which holds the prefix

    3. A calculated field which combines 1 & 2

     

    It’s not elegant but it works well

  • Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @krp28 

     

    @HSheild accomplished this the same way I did on a prior project.  I actually set the Name field with a suffix of the auto-number and a prefix that was dependent on another field similar to your needs.  It would be nice if the auto-number format options would allow this but they do not.

     

    Thanks,

    Drew

     

  • ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @krp28,

    As @HSheild mentions, this cannot be achieved using the AutoNumber field alone. The sequence is generated when the form opens if creating it interactively which is done for performance/scalability reasons.

    A calculated field should work as suggested above.

    If you need to set the name (primary field) of the record to the prefix + auto generated number, you can use a classic synchronous workflow or a Power Automate flow (asynchronous) that triggers on creation of the record or update when the prefix selection or AutoNumber value changes. This is a common pattern used for setting the name of the record automatically. 

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving 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

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard