web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Group by in Power Auto...
Power Automate
Unanswered

Group by in Power Automate - Data Step: List Records - FetchXML

(0) ShareShare
ReportReport
Posted on by 8

Hi Community,

 

Please your kind help, I'm using: 'Data Step: List Records', in which need to do a 'Group By', so decided using “FetchXML” section, to group by the Contacts per status, but get error.

 

The xml only allows to 'group by' contact id, and is the following:

<fetch aggregate="true" >
<entity name="contact">
<attribute name="contactid" alias="contactid" groupby="true" />
<attribute name="statecode" alias="statecode" aggregate="count" />
</entity>
</fetch>

The result:
——Contact Id——State Code
AAedcf55-df22-eb11-a813-000d3a361686 —- 1
bbbbbbbb-df22-eb11-a813-000d3a361686 —- 1

 

 

Grouping by ‘state code’ there is an error.

<fetch aggregate="true" >
<entity name="contact">
<attribute name="contactid" alias="contactid" aggregate="count" />
<attribute name="statecode" alias="statecode" groupby="true" />
</entity>
</fetch>


How can I group by in fetch xml for Power Automate Flow? to get this:
——Amount of Records——State Code
——3——————-1
——4——————-0

 

Contact Selection.PNG

 

Thanks and best regards.

Categories:
I have the same question (0)
  • Verified answer
    ChrisPiasecki Profile Picture
    6,422 Most Valuable Professional on at

    Hi @roxana_cq,

    FetchXml aggregation is not currently supported in the List Records action in Power Automate.

     

    You can use the HTTP with Azure AD connector to send a request to the Dataverse Web API, passing the encoded FetchXml in the query string parameter.

    Refer to this article for a good example of this:

    https://tldr-dynamics.com/blog/fetchaggr-auto-reporting

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard