cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
edtroit
Helper I
Helper I

Need help filtering and getting a new array

I have a documents table with a lookup Employee colum that relates to the EmployeeID column in the employees table

 

What I have so far is a List rows action for the documents table with a date filter to find expired documents. Then, assuming this is the best way, a List rows action for the employees table. The problem I'm having is with the next step filling out the filter array action to get an array of just the matching employees with expired documents. Not sure if the filter array action needs to be in Apply to each action or not. If anyone could provide an example or point me to this solution elsewhere I would greatly appreciate it or a better way. Thank you all for your help.

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @edtroit 

 

There are different ways you could do this in one query. 

 

FetchXML Query

 

Use FetchXML to query data (Microsoft Dataverse) - Power Apps | Microsoft Docs

 

WebAPI Query

 

Retrieve related table records with a query (Microsoft Dataverse) - Power Apps | Microsoft Docs

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

Hey @abm 

 

Thank you this worked! Also thanks for your youtube videos, just realized I've been watching your videos. For anyone in the future please see my screenshot below. Please note in the link-entity node the from is the matching attribute/column of the table you are relating to in the name field and the to is the related attribute/column in the table you are calling the List rows action on.

 

fetch example.jpg

View solution in original post

7 REPLIES 7
abm
Super User
Super User

Hi @edtroit 

 

Whats the datasource for this? (SharePoint, Dataverse, SQL, etc)?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hey @abm I'm using dataverse.

Hi @edtroit 

 

Are there any 1:M relationship between Employees and documents?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hey @abm 

 

Yes, there is a 1:M relationship between Employees and documents.

 

thank you

Hi @edtroit 

 

There are different ways you could do this in one query. 

 

FetchXML Query

 

Use FetchXML to query data (Microsoft Dataverse) - Power Apps | Microsoft Docs

 

WebAPI Query

 

Retrieve related table records with a query (Microsoft Dataverse) - Power Apps | Microsoft Docs

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hey @abm,

 

Thanks this solution sounds much better! This example from your link looks to be exactly what I need. Was not aware of all the capabilities with FetchXML. I will try this out and provide an update, thank you for the guidance!

 

Use FetchXML to query data (Microsoft Dataverse) - Power Apps | Microsoft Docs

This example shows an inner join between EntityMap and AttributeMap where the EntityMapID matches.

<fetch version='1.0' mapping='logical' distinct='false'>  
   <entity name='entitymap'>  
      <attribute name='sourceentityname'/>  
      <attribute name='targetentityname'/>  
      <link-entity name='attributemap' alias='attributemap' to='entitymapid' from='entitymapid' link-type='inner'>  
         <attribute name='sourceattributename'/>  
         <attribute name='targetattributename'/>  
      </link-entity>  
   </entity>  
 </fetch>

 

Hey @abm 

 

Thank you this worked! Also thanks for your youtube videos, just realized I've been watching your videos. For anyone in the future please see my screenshot below. Please note in the link-entity node the from is the matching attribute/column of the table you are relating to in the name field and the to is the related attribute/column in the table you are calling the List rows action on.

 

fetch example.jpg

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (5,025)