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 Pages / How to groupby based o...
Power Pages
Unanswered

How to groupby based on link-entity attribute using fetchXml in portals?

(0) ShareShare
ReportReport
Posted on by 499

Hi All, we have any option to GROUPBY the records based on link-entity? I am working on a requirement where I need to group by the results based on the link entity attribute. Below is the Fetch XML I am using.

When I am using groupby="true" getting Liquid error: Exception has been thrown by the target of an invocation.

 

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
 <entity name="PRIMARYENTITY">
 <attribute name="PRIMARYENTITYid" />
 <attribute name="PRIMARYENTITYNAME" />
 <link-entity name="SECONDARYENTITY" from="SECONDARYENTITYid" to="SECONDARYENTITY" link-type="inner" alias="ap">
 <attribute name="SECONDARYENTITY_name" groupby="true"/>
 <filter type="and">
 <condition attribute="SECONDARYENTITYid" operator="eq" uitype="SECONDARYENTITY" value="{2D1C78B9-237A-EC11-8D21-000D3A5BB4A6}" />
 </filter>
 </link-entity>
 </entity>
</fetch>

 

Categories:
I have the same question (0)
  • Fubar Profile Picture
    8,352 Super User 2025 Season 2 on at

    Suspect the error is because FetchXML also needs aggregate=true to use groupby

     

    <fetch distinct='false' mapping='logical' aggregate='true'>

     

    https://docs.microsoft.com/en-us/power-apps/developer/data-platform/use-fetchxml-aggregation#group-by-with-linked-entity

  • SaiKrishnaGudluru Profile Picture
    499 on at

    @Fubar Yeah, initially I tried "aggregate" too, but no luck. Receiving same error.

  • Fubar Profile Picture
    8,352 Super User 2025 Season 2 on at

    I would double check the FetchXML by putting it into XrmToolBox to verify its valid FetchXML etc.

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 Pages

#1
Fubar Profile Picture

Fubar 74 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 55

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard