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

Retrieving Data from multiple Entities with N relationships

So the requirement is that I have around 4 entities with 1:N relationships and I need to extract it into a single line for each combination.  This would be like using a Select statement with 'Joins' or 'In' constructs in SQL.  Is there a way of doing something similar in Flow?

 

Please let me know

Mark

5 REPLIES 5
Mira_Ghaly
Dual Super User II
Dual Super User II

@deg85 

If you can save your query in a stored procedure, please check if this template helps you

 

https://australia.flow.microsoft.com/en-us/galleries/public/templates/23dbc08dfecf40109d9b0d4164b78c...

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

@Mira_Ghaly 

 

Hello, Thanks for your reply.

 

Im sorry but I am still quite very new to power automate and the whole d365 thing... so it is possible to query data from entities in CDS using good old sql?

 

kind regards

Mark

Mira_Ghaly
Dual Super User II
Dual Super User II

@deg85

Sorry I didn't understand that you are using CDS, so basically you can use the CDS(Current Environment connector) to query CDS and the FetchXML is a very nice and easy feature to use while querying CDS.

 I will provide you with some links below

https://carldesouza.com/use-fetchxml-the-in-power-automate-cds-connector-for-list-records/

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

@Mira_Ghaly 

 

Thanks again for your reply.

 

The problem is I want to extract data from multiple related entities and store the data in a single row in another entity, which will be used for reporting.

 

Basically I Have Entity1 Entity2, Entity3, Entity4 and I would like a couple of fields from each.  if it were a 1:1 relationship I could (probably) work with for each loops  but it isnt, so i do not think the for each loop wil work. the FetchXML  example will only return data from one entity, unless I am missing something, you cannot return data from multiple entities using the List Records connector?

 

thanks!

Mark

Reimi
Community Support
Community Support

By using query, you can get a record that relates to another entity.

so, use "Get a record" action with query to all entities, and then store data in a single row.

Reimi_0-1601034493662.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (1,755)