| Editorial Team
Content: The $expand query parameter is a powerful feature in Power Automate that allows you to retrieve related data from a connected entity or collection based on a lookup field in the current entity. By utilizing $expand, you can retrieve multiple records in a single API call, reducing the number of API calls required to fetch related data. This not only improves performance but also helps avoid hitting API rate limits.
To leverage the $expand functionality in Power Automate, follow these simple steps:
- Create a new flow or open an existing one in Power Automate.
- Add a new action to your flow, such as “List records” or “Get record(s).”
- In the action settings, locate the “Expand Query” field and input the name of the related entity or collection you wish to retrieve data.
- Click the “Edit in advanced mode” link to access the advanced mode editor.
- Within the advanced mode editor, enter the JSON code for the $expand expression, as shown below:
{
"Contacts": {
"$select": [
"fullname",
"emailaddress1",
"telephone1"
]
}
}
The above $expand expression expands the “Contacts” entity using the lookup field in the “Accounts” entity while also selecting three specific fields from the related “Contacts” records: fullname, emailaddress1, and telephone1. - Save the action settings and continue building your flow.
- Use the expanded data array in subsequent actions within your flow, such as sending an email to the contacts or updating their records in a CRM system.
By following these steps, you can harness the power of $expand in Power Automate to efficiently retrieve and work with related data, streamlining your workflow and enhancing overall efficiency.