cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Guilherme_Lara
Frequent Visitor

Filter an entity based on another entity (join entities) in Filter Query

Hello,

I'm trying to build a "Get Record" step from using the Dynamics 365 connector. I create a query using the advanced query of Dynamics. What I'm trying to do is select all security roles from an user of the system. The problem is that I dont know how to reproduce my query with the Filter Query of Power Automate. This is the Fetch XML I have:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
  <entity name="role">
    <attribute name="name" />
    <attribute name="businessunitid" />
    <attribute name="roleid" />
    <order attribute="name" descending="false" />
    <link-entity name="systemuserroles" from="roleid" to="roleid" visible="false" intersect="true">
      <link-entity name="systemuser" from="systemuserid" to="systemuserid" alias="ab">
        <filter type="and">
          <condition attribute="fullname" operator="eq" value="John Lennon" />
        </filter>
      </link-entity>
    </link-entity>
  </entity>
</fetch>

I searched here in the forum and in the internet but did not find anything... Can you help me?

Thanks!

 

1 REPLY 1
Microsoft
Microsoft

Re: Filter an entity based on another entity (join entities) in Filter Query

Hey @Guilherme_Lara ,

 

You are almost there! Requirement is that you must create Flow under a solution, and use "Common Data Service (current environment)" connectors.

 

Please try as following:

 

1. Make sure to select right environment:

image.png

 

 

 

 

2. Click on Solutions

3. Create a new Solution

4. Add a Flow

image.png

 

5. Create your Flow as you have done before

 

6. Use Action called "List Records", but make sure to select it from "Common Data Service (current environment)" connector:

image.png

 

7. Place yout FetchXML on "FetchXML query" as bellow:

image.png

 

Triggering your flow, now you must have something like that:

 

 

image.png

image.png

 

I hope this can helps you.

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,643)