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
tavila
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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (68,064)