How to use Expand Query in MS Flows

Introduction

This blog explains how to use Expand Query (N:1 Relationship) in the Common Data Service(Current Environment) List Records Connector.

Use Case: In my example, I am retrieving details of the Project entity which is related to the Location entity.

Steps to be followed:

  1. Add List Records Action.

Expand Query: vv_Project($select=vv_name,vv_projectabbreviation)

Explanation: Here vv_Project is the Schema Name of Project Lookup field on location entity.

Pass the field names of the project entity that  you want. Here I have passed vv_name and vv_projectabbreviation.

  1. Result of list record.

You can see we got Project values in the output of list records.

  1. Retrieving Project Values.
  • Use “Apply to each” to get the value of the Project.
  • Pass “Value” of “List Records” from Dynamic Content in “Select an output from previous steps”
  1. Add Compose Action inside Apply to each.
  • Enter “Project Name” in “Compose” from Dynamic Content.

similarly you can get Project Abbreviation value.

Output:

Entire Flow:

NOTE:  You can add multiple entities in expand query

Query: vv_Project($select=vv_name,vv_projectabbreviation),vv_ProjectTask($select=vv_name)

Output:

Leave a Reply

Your email address will not be published. Required fields are marked *