![](https://static.wixstatic.com/media/3fdf17_f68edcad77e247f8890d4f5673f0b50a~mv2.png/v1/fill/w_980,h_551,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/3fdf17_f68edcad77e247f8890d4f5673f0b50a~mv2.png)
Are you tired of jumping through hoops to retrieve data from related tables in Power Automate? Say goodbye to cumbersome processes and hello to efficiency with the “expand query” feature. By leveraging the expand query in Power Automate, you can streamline the retrieval of properties from related tables without the need for additional steps. In this tutorial created by our RedCloud Digital Solutions Practice team, we’ll walk you through the process step by step, demonstrating how to set up the flow, identify navigation properties, utilize them, and parse JSON to get the desired output. Let's dive in!
Utilizing the expand query in Power Automate can streamline the retrieval of properties from related tables without the need for additional steps. Here's a brief example:
Step 1: Set Up the Flow
Begin by creating a flow that uses the Dataverse List Rows action. In this demonstration, the flow is manually triggered, listing “Accounts” from Dataverse. To limit the output, a row count is set to one.
![](https://static.wixstatic.com/media/3fdf17_0768628279424f449c62b3dbd84ecd9d~mv2.png/v1/fill/w_569,h_497,al_c,q_85,enc_auto/3fdf17_0768628279424f449c62b3dbd84ecd9d~mv2.png)
Step 2. Identify Navigation Properties
Subsequently, use the Compose action to output the result from the List “Account” action.
![](https://static.wixstatic.com/media/3fdf17_184b1dddbf3542aba001e59c8e668f09~mv2.png/v1/fill/w_551,h_814,al_c,q_90,enc_auto/3fdf17_184b1dddbf3542aba001e59c8e668f09~mv2.png)
This output serves to identify the navigation properties necessary for expanding related tables. Copy this output.
![](https://static.wixstatic.com/media/3fdf17_9a213015130846a090c773dfb597fd81~mv2.png/v1/fill/w_563,h_714,al_c,q_90,enc_auto/3fdf17_9a213015130846a090c773dfb597fd81~mv2.png)
Step 3. Utilize Navigation Properties
In Visual Studio Code, search for navigation properties. These properties enable the expansion of related tables directly within the list rows action, eliminating the need for separate steps to retrieve related table values.
![](https://static.wixstatic.com/media/3fdf17_2aaf1068bbc1450abe807953418aeae4~mv2.png/v1/fill/w_624,h_51,al_c,q_85,enc_auto/3fdf17_2aaf1068bbc1450abe807953418aeae4~mv2.png)
To specify specific columns from the related table, OData queries can be employed. For instance, to retrieve Country details (Region, Location, and Currency) associated with a case, the following query can be used:
![](https://static.wixstatic.com/media/3fdf17_d45c84fde36c429784b728d9ab9f99f0~mv2.png/v1/fill/w_557,h_628,al_c,q_85,enc_auto/3fdf17_d45c84fde36c429784b728d9ab9f99f0~mv2.png)
Step 4: Parse JSON
OData for expanding Country and selected properties will result in the JSON output shown below.
![](https://static.wixstatic.com/media/3fdf17_b4629fd1d91b474694ed58c7f5ae7576~mv2.png/v1/fill/w_624,h_147,al_c,q_85,enc_auto/3fdf17_b4629fd1d91b474694ed58c7f5ae7576~mv2.png)
By generating a sample from the JSON above, it will result as the following output in your flow.
![](https://static.wixstatic.com/media/3fdf17_9b3500b6455b4d7aa343f3cc9063068b~mv2.png/v1/fill/w_587,h_631,al_c,q_90,enc_auto/3fdf17_9b3500b6455b4d7aa343f3cc9063068b~mv2.png)
Comments