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

Announcements

News and Announcements icon
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,530 Super User 2026 Season 1 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,530 Super User 2026 Season 1 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
sannavajjala87 Profile Picture

sannavajjala87 42 Super User 2026 Season 1

#2
Valantis Profile Picture

Valantis 35

#3
Fubar Profile Picture

Fubar 23 Super User 2026 Season 1

Last 30 days Overall leaderboard