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 / Collection with Ids an...
Power Apps
Answered

Collection with Ids and Values in Canvas App from dataverse Global Choice Option Set

(4) ShareShare
ReportReport
Posted on by 938
How do I get the numeric values with the Labels from a Global Choice list in a collection? Using value only gives me the Label , Id isn't a valid option to try and get the Value 
I want the Value number too if possible 
 
 
ClearCollect(
    colExceptions,
     Choices('AP Invoice Exceptions')
);
 
 
 
ClearCollect(
    colGlobalChoices,
    Choices([@'AP Invoice Exceptions'])
);
 
 
 
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     
    The Choices() function in canvas apps only returns the label as the Value property. The numeric code is not exposed through Choices() directly this is a confirmed limitation.

    To get both the label and the numeric value, the confirmed approach is to call the Dataverse Web API via a Power Automate flow and load the results into your collection.

    In Power Automate, use the Invoke an HTTP request action with the Dataverse connector:
    GET /api/data/v9.2/GlobalOptionSetDefinitions(Name='your_optionset_logical_name')?$format=application/json;odata.metadata=none
    This returns the full option set definition including each option's Value (numeric code) and Label. Parse the JSON response and return an array of {Label, NumericValue} pairs back to Power Apps.

    Then in your canvas app:
    ClearCollect(colGlobalChoices, YourFlow.Run())
    This gives you a proper collection with both the display label and the numeric code.
    The logical name of your global choice is not the display name it's the schema name in lowercase with your publisher prefix, like cr20b_apinvoiceexceptions. You can find it in make.powerapps.com > Choices > open the choice > check the Name field.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • Verified answer
    sumit_artesian Profile Picture
    261 on at
     
    Trying to fetch the values using just the Choices() function will always return the labels. However, the labels also store the integer value; it's just not exposed directly. To get the numeric value for your choices, you will have to typecast the labels into int
     
    Here is the formula you need:
    ClearCollect(
        colGlobalCollection,
        AddColumns(
            Choices('Subgroup Name Choices'),
            NumericValue,
            Int(ThisRecord.Value)
        )
    )
     
    In this formula, we are fetching the choice values to store in the collection colGlobalCollection, but we are also adding another column in the collection, which I have named NumericValue for the sake of this example, and we typecast the choice labels into an integer and store it in that column.
     
    Here are some screenshots for your reference:
    The actual global choice values:
     
    The collection of data:
     

    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item.
    If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like! 🩷
  • sumit_artesian Profile Picture
    261 on at
     
    The Web API approach would work, but that would make the application premium as the HTTP action is part of a premium connector. Going that route also is a hassle with so many additional steps.
     
    There is a way to directly get the integer choice values which I have demonstrated in my response above.
  • Suggested answer
    11manish Profile Picture
    3,333 on at
    Unfortunately, the underlying numeric Option Set value (the integer stored in Dataverse) is not directly returned by Choices() in Canvas Apps.
     
    You can retrieve Global Choice metadata using:
    • Dataverse Web API
    • Custom connector
    • Power Automate
    Endpoint example:
    • /api/data/v9.2/GlobalOptionSetDefinitions

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard