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 Apps
Unanswered

auto assign prefix

(0) ShareShare
ReportReport
Posted on by 124

I want to assign a prefix to a form when they select a specific lookup option. eg- report is for School A so A will be a prefix, if its School B, B will be the prefix. The prefix can be stored in the same table with the School type. Any solutions will be helpful

I have the same question (0)
  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @Sean9

    You easily achieve this with formula columns. So the expression would be something like this. 
    Note: replace "Primary Contact" with the School lookup and navigate to the desired type, and replace "Account Name" with the remaining part.

    EricRegnier_0-1699619084710.png

     

    Here's more info: https://learn.microsoft.com/power-apps/maker/data-platform/formula-columns

    Hope this helps!

  • Sean9 Profile Picture
    124 on at

    sorry, i meant prefix for the autonumber so users would select school A and then it would be A-1000 as the autonumber

  • ivan_apps Profile Picture
    2,187 Moderator on at

    I wish this was possible but the OOTB autonumber doesn't support dynamic prefixes.  You would need a custom auto-numbering system created where you could define the prefix per choice value. I've done it in the past, the sequential numbering is tricky since you have to lock the table during the assignment of the sequential number, but if you add a random set of characters it's a bit easier.

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

    Hi @Sean9 ,

    I would do the following, hopefully it makes sense...

    1. Setup standard autonumbering column that would not have a prefix.
    2. Setup another text field that you can populate with a real-time workflow that concatenates a prefix (based on your A / B logic) and then the autonumber field on the backend.  You can set this up if the field changes that might affect the value.  
  • Sean9 Profile Picture
    124 on at

    Hi @dpoggemann , could i do this via a concat formula where i call a table and its column where the prefix is stored relating to the lookup and then put the autonumber in the currect table next to it?

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    @Sean9, cheers for clarifying. You can still achieve with formula columns, but you'll need to create an autonumber column with no prefix then in your formula column reference the value of that autonumber column, and done!

  • Sean9 Profile Picture
    124 on at

    hi @EricRegnier , thank you for replying, so i have been trying this like this: 

    so below calls the prefix and then the ID. The lookup column is called name in the table TAuditType. This formula keeps showing errors. Any idead?

    Sean9_0-1699957322625.png

     

  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    If you hover over the error, what does it say? I tried on the account table and looks good from my side. Note: "Primary Contact" is a contact lookup and "Full Name" is a text column on the contact.

    EricRegnier_0-1699957880965.png

     

  • Sean9 Profile Picture
    124 on at

    Thank you @EricRegnier just solved it i was calling the whole table in the formula instead of the lookup and then the specific column for the prefix 🙂

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard