cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (6,795)