Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

how to use Dataverse list rows with global choice tables

Like (1) ShareShare
ReportReport
Posted on 21 Feb 2025 18:58:00 by 18
I have a global choice table named Documents in Dataverse that I am using to create Document sequence numbers using table Documents numbers. I am building an instant flow with trigger when a row is selected using Business Unit table. I would like to use the document Global choice table using List rows or another action and the add rows to the document numbers table using all documents labels or values. I am using _businessunitid_value or _organizationid_value as fileter in the list rows but is nor returning records. What I need to do in the list rows to list all labels or values available?
Categories:
  • JS-18081230-0 Profile Picture
    18 on 22 Feb 2025 at 11:33:33
    how to use Dataverse list rows with global choice tables
    Hello Ravi, 
    Ther are to Invoke an HTTP Request actions
    HHTP with Microsoft Entra ID
    HTTP with Microsoft Entra ID (preauthorized).
     
    I tried with both, and the following error appears
    Failed to create OAuth connection: ClientError: AADSTS500011: The resource principal named https://orgfb1a8001.crm.dynamics.com/api/data/v9.1/GlobalOptionSetDefinitions(Name='Documents') was not found in the tenant named JJ-Analytics. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant. Trace ID: c43f7f7a-a240-4e35-95bb-dc78fc791400 Correlation ID: 88357af2-8036-4a31-9ebb-5c92d69cd002 Timestamp: 2025-02-22 11:25:57Z
    What I need to do  fix this there is an option to create a gateway I have one already defined. but is not working.
  • JS-18081230-0 Profile Picture
    18 on 22 Feb 2025 at 11:10:54
    how to use Dataverse list rows with global choice tables
    Thank you looks great for me.
  • Suggested answer
    Ravi-Prajapati Profile Picture
    409 on 22 Feb 2025 at 06:50:46
    how to use Dataverse list rows with global choice tables

    In your Power Automate flow, the issue is likely due to how you're querying the Global Choice (Option Set) table in Dataverse. Here's how you can correctly retrieve all labels or values from your Documents global choice table and add them to your Document Numbers table.


    Solution Steps

    1. Retrieve Global Choice (Option Set) Values

    Dataverse Global Choices (Option Sets) are not stored as separate table records, so you cannot use "List rows" like a normal table. Instead, you must retrieve the metadata of the choice field.

    • Use the "Invoke an HTTP request" action in Power Automate to call the Dataverse Web API:

      API URL to get global choice values

      https://YOUR_ENVIRONMENT_URL/api/data/v9.1/GlobalOptionSetDefinitions(Name='Documents')
      • Replace YOUR_ENVIRONMENT_URL with your actual Dataverse environment URL.
      • This will return all available labels and values from your Documents choice field.

    2. Extract Labels and Values from Response

    • Parse the JSON response using "Parse JSON" action.
    • The response contains:
      • Labels (text names of choices)
      • Values (numeric IDs for choices)

    3. Loop Through and Add to Document Numbers Table

    • Use a "Apply to Each" loop to iterate over all retrieved choices.
    • Use the "Add a new row" action in Dataverse to insert each choice into the Document Numbers table.

    Alternative: Manually Store Choices in a Table

    If using the API isn't feasible, consider:

    1. Creating a Dataverse Table to store the Document types manually.
    2. Using a List rows action on this table instead of the global choice field.

    Summary

    âś… Global Choices (Option Sets) are not stored as table records.
    âś… Use Dataverse API to retrieve all labels/values from the choice field.
    âś… Loop through the response and add records to the Document Numbers table.
    âś… Alternative: Store choices in a separate Dataverse table for easy querying.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 109

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 90 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 62 Super User 2025 Season 1

Overall leaderboard