cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

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
Highlighted
Microsoft
Microsoft

Hey @Anonymous ,

 

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.

Tarcisio Vilas Boas

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (9,674)