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 / Portals Fetchxml - Una...
Power Pages
Unanswered

Portals Fetchxml - Unable to retrieve aggregation values from linked entity

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I'm having a hard time trying to get the aggr. values from the linked entity using the following code:

 

{% fetchxml cp_account %}
<fetch version="1.0" ouput-format="xml-platform" mapping="logical" aggregate="true">
<entity name="cr346_cp_account" >
<attribute name="cr346_debtor_no" alias="debtorno" groupby="true" />
<link-entity name="cr346_cp_balancehistory" from="cr346_primarycontact" to="cr346_primarycontact" link-type="inner" alias="balancehistory" visible="true" >
<attribute name="cr346_debtor_no" alias="debtornoBH" groupby="true" />
<attribute name="cr346_account_no" alias="accountnoBH" groupby="true" />
<attribute name="cr346_trans_amt" alias="transamount" aggregate="sum" />
<attribute name="cr346_balance_fwd" alias="balancefwd" aggregate="sum" />
<filter type="and" >
<condition attribute="cr346_primarycontact" operator="eq" value="{{user.id}}" uiname="{{user.fullname}}" uitype="contact" />
</filter>
</link-entity>
</entity>
</fetch>
{% endfetchxml %}
{% assign cp_balancehistory_results = cp_account.results.entities %}
<table>
<tr>
<th>Debtor Number</th>
<th>Account Number</th>
<th>Current Period Charges</th>
</tr>
 
{% for result in cp_balancehistory_results %}
<tr>
<td>{{ result.debtorno }}</td>
<td>{{ result['balancehistory.BHAccountNo.'] }}</td>
<td>{{ result['balancehistory.BHTransAmnt'] }}</td>
</tr>
{% endfor %}
</table>
 
No matter what I try it only shows the debtorno.
 
Any help will be appreciated.
 
Thanks,
Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

    Hi

     

    I am bit unsure with the groupby and alias in the attributes, can you make your fetch a bit simpler to test it out

     

    and then instead of: 

    <td>{{ result['balancehistory.BHAccountNo.'] }}</td>
     
    try:
    <td>{{ result['balancehistory.cr346_account_no.'] }}
     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

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 38 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