
Announcements
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
Thanks and best regards.
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.