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 / How to get the ID of a...
Power Apps
Unanswered

How to get the ID of a CRM OptionSet value instead of label

(0) ShareShare
ReportReport
Posted on by 31

Hi, 

 

I have an option set on a CRM named "Categorie" that contain the following values : 

- Book  (10000001)

- DVD   (10000002)

- VHS    (10000003)

 

Currently i have the following condition on my apps 

 

Filter(Options; Text(Categorie) = "Book")

 

But if the label of one categorie change, i have to change my condition. 

 

How can i get the ID "10000001" instead of the label ? 

 

Many thanks

Categories:
I have the same question (0)
  • SafaK Profile Picture
    62 on at

    you can always Filter or compare the OptionSet using the following   [@OptionSetName].Value


    If( ComparedValue = [@Categorie].Book , 1, 0 )      

    This way, you are selecting the label (comparing two labels) but in reality it's comparing it with the ID, therefore if you are using the above code, even if the label was changed this will still work because it will change automatically based on the ID .

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @jdos3502 

     

    You can use the enum value to filter/compare it instead of Text()

     

    In this below example, 'Relationship Type' is an option set

     

     

    Filter(
     [@Accounts],
     'Relationship Type' = 'Relationship Type (Accounts)'.Consultant
    )

     

    When you change the label of the option set Powerapps changes automatically. You can create one small test application and test it.

     

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

#2
11manish Profile Picture

11manish 186

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 105 Super User 2026 Season 1

Last 30 days Overall leaderboard