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 Automate / how to use Dataverse l...
Power Automate
Suggested Answer

how to use Dataverse list rows with global choice tables

(1) ShareShare
ReportReport
Posted on 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:
I have the same question (0)
  • Suggested answer
    Ravi-Prajapati Profile Picture
    416 Super User 2025 Season 2 on at

    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.

  • JS-18081230-0 Profile Picture
    18 on at
    Thank you looks great for me.
  • JS-18081230-0 Profile Picture
    18 on at
    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.

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard