Linked entities in FetchXML are entities that are related to the primary entity specified in the FetchXML query. Linked entities allow you to retrieve data from multiple related entities in a single query, and to traverse the relationships between entities to retrieve related data.
When you are filtering records in Power Automate with FetchXML you might need to use linked entities. But unlike top entity, you will not be able to find dynamic content for linked entities that you specified in your FetchXML.
Assume you have FetchXML like this:
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="my_entity">
<attribute name="my_name" />
<link-entity name="account" from="accountid" to="my_lookupid" link-type="outer" alias="acc">
<attribute name="accountnumber" />
</link-entity>
</entity>
</fetch>
Inside the action, you can use the account attributes returned by the FetchXML query by accessing the output of the action by adding alias as prefix. So you can access the “accountnumber” attribute as follows:
item()?[‘acc.accountnumber’]. Note that the “acc” alias used in the FetchXML query is used to prefix the “accountnumber” attribute in Power Automate.
You can use the values of these attributes in various actions within the “For each” loop, such as creating a new record, sending an email, or updating a record.