In Microsoft Dynamics 365 I needed to get a list of member’s email addresses in a team. To do this I had to use Fetch XML Query on a List Rows Action in Power Automate.

First I created a compose action to get the owner ID of your target entity (I am using Orders in my example)

Next I created a List Rows Action and pasted the xml from here

Here is the code if the website above is not working (Take note of condition value below, that will be your dynamic content):

<fetch mapping="logical" output-format="xml-platform" version="1.0" distinct="true">
<entity name="systemuser">
<attribute name="fullname" />
<attribute name="systemuserid" />
<attribute name="internalemailaddress" />
<order descending="false" attribute="fullname" />
<link-entity name="teammembership" visible="false" to="systemuserid" from="systemuserid" intersect="true">
<link-entity name="team" to="teamid" from="teamid" alias="ac">
<filter type="and">
<condition value="@{outputs('Compose')}" attribute="teamid" operator="eq" />

After that I was able to pull the primary email address for each team member and store in an array to use for a send email action!