cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Is it possible to use GROUP BY in expand query list records action

Hello All,

I am trying to get list of records associated to parent entity in dynamics 365 using a flow and i needed to group the related records GROUPED BY certain fields of the related entity, is there any way to do that? 

3 REPLIES 3
Super User III
Super User III

Hi @selam 

 

Looks like you can. Please see this post about how to generate the FetchXML for related entity group by. Once you have the fetch you can run the query via CDS connector.

 

https://crmchartguy.com/2013/05/27/groupby-on-a-related-entitys-related-entity/

 

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
Frequent Visitor

@abm  thank you for your response, that would have really worked for me except i have more than 10 entities to link to so if i used fetch xml query it errors out that i have reached the max number of link entity, Si i have to really use flow's get record to achieve that and when getting children records i want to get distinct records or some how group them by some value, please let me know if you have any tips.  

Super User III
Super User III

Hi @selam 

 

You could use fetchxml distinct 'true'

image.png

 

To run the fetchxml you need Common Data Service Default Environment. To access this connector you need to create a solution, then create flow. Search for Common Data Service. Select the second from the list. Use Get List Items and set the fetchxml query.

 

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

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (11,351)