Power Automate: Efficiently Retrieve Dataverse Lookup Values Using Expand Query
Introduction
When building Power Automate flows with Microsoft Dataverse, retrieving lookup column data is a very common requirement.
However, many flows are designed in a way that retrieves only lookup GUIDs, forcing additional Dataverse calls to fetch related data. This approach increases complexity, execution time, and API usage.
In this article, we’ll see how to efficiently retrieve lookup values in a single call using the Expand Query option in the Dataverse List rows action.
The Challenge with Lookup Columns
Consider a Dataverse table cs_ticket that has a lookup column cs_CustomerContact pointing to a Contact table. When you retrieve rows using List rows without an expand query, the lookup column returns only the GUID.
Sample output
"_cs_customercontact_value": "7c8ffb96-00a7-47c0-b587-a6c652d66b34"Problems with this approach
You cannot access contact details like email or contact number
You need an additional “Get a row by ID” action
Flow becomes slower
Increased Dataverse API calls
The Solution: Use Expand Query
The Expand Query option allows you to retrieve related lookup data inline, avoiding extra Dataverse calls. With $expand, related entity fields are returned as part of the same response.
Step 1: Add the List rows action and select your Dataverse table.
Step 2: Configure Select columns, Expand Query
Expand Query: cs_CustomerContact($select=cs_contactname,cs_contactemail)
Tip: $expand always uses the lookup schema name, while $select inside expand uses logical column names from the related table.
Output Comparison
❌ Without Expand Query
"_cs_customercontact_value@OData.Community.Display.V1.FormattedValue": "Ben","_cs_customercontact_value@Microsoft.Dynamics.CRM.associatednavigationproperty": "cs_CustomerContact","_cs_customercontact_value@Microsoft.Dynamics.CRM.lookuplogicalname": "cs_contact","_cs_customercontact_value": "7c8ffb96-00a7-47c0-b587-a6c652d66b34",You must make another Dataverse call to get contact details (e.g. email address).
✅ With Expand Query
"cs_CustomerContact": { "cs_contactid": "d1a22df0-1316-4cab-bb20-4dc67fabdaf0", "cs_contactname": "Cal", "cs_contactemail": "cal@contoso.com" }All required data is retrieved in a single call.
Why This Approach Is Better
๐ Performance
Single Dataverse call
Faster flow execution
๐ฐ Lower API Consumption
Fewer Dataverse read operations
Scales better for large datasets
๐งน Cleaner Flow Design
No extra “Get row by ID” actions
Easier to debug and maintain
๐ง Best Practice
Recommended for production-grade flows
Aligns with Dataverse OData standards
Conclusion
By leveraging the Expand Query option in Power Automate’s Dataverse List rows action, you can retrieve lookup column data efficiently and avoid unnecessary additional calls. This approach results in faster flows, reduced API usage, and cleaner automation design.
If your flow relies on lookup data, Expand Query should be your default approach.
Comments
Post a Comment