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.