How to use $expand in Power Automate

| 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:

  1. Create a new flow or open an existing one in Power Automate.
  2. Add a new action to your flow, such as “List records” or “Get record(s).”
  3. In the action settings, locate the “Expand Query” field and input the name of the related entity or collection you wish to retrieve data.
  4. Click the “Edit in advanced mode” link to access the advanced mode editor.
  5. 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.
  6. Save the action settings and continue building your flow.
  7. 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.


M
Chief Architect, Founder, and CEO - a Microsoft recognized Power Platform solution architect.

About The Blog

Stay updated with what is happening in the Microsoft Business Applications world and initiatives Imperium is taking to ease digital transformation for customers.


More About Us

We provide guidance and strategic oversight to C-Suite and IT Directors for on-going implementations. Feel free to give us a call.

1 331 250 27 17
Send A Message

Ready to Start?

Get a personalized consultation for your project.

Book a Meeting