cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

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

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

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

@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.  

Highlighted
Super User III
Super User III

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

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

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (10,462)