Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
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>

 

  • Fubar Profile Picture
    8,010 Super User 2025 Season 1 on at
    Re: How to groupby based on link-entity attribute using fetchXml in portals?

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

  • SaiKrishnaGudluru Profile Picture
    499 on at
    Re: How to groupby based on link-entity attribute using fetchXml in portals?

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

  • Fubar Profile Picture
    8,010 Super User 2025 Season 1 on at
    Re: How to groupby based on link-entity attribute using fetchXml in portals?

    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

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35