Skip to main content

Notifications

Power Pages - General Discussions
Suggested answer

How do I group and sum data without using PowerBi - please help

Posted on by
Can someone please help. I have created a dataverse table in power pages and I want to display the data from this table grouped and summed.
I could use something like PowerBI but I want to group and sum it for free, not pay.
I tried Liquid code but can’t get it to work – see details in post.

I am new to power apps and power pages, I have very limited coding experience.
I need to take the data from my dataverse tables and display it on screen, for external customers, grouped and summed.

So for example I have a dataverse table called ATestTable1 with two fields “Name” and “Weight”
I want to show the data from this grouped on the Name field with a subtotal of Weight per grouped Name, and an overall total of Weight.

I am using ChatGPT to walk me through it.
It says the only free way I can display a grouped/summed table/report on power pages is to use Liquid code.
But I have gone around in circles with it trying to get it to work.

When I create a page in power pages and add the ATestTable1 as a List – it displays fine (in design mode and preview) – I can see the data displayed from the table fine.

ChatGPT has given me liquid code to try – for the grouping and summing – but it doesn’t work – no data at all comes through.

I told GPT to give me the simplest possible liquid code (no grouping or summing) just to see if could pull any data at all from the table.

It gave me the following code. I went to Edit Code on the power pages page, and inserted the code there, saved, synced back in ppages.
But after syncing I get “No records found in the table” (as per the last condition of the code it gave me).

The powerpages will ultimately be used for dozens of external customers


So my questions are:

Is liquid the only way I can get a grouped/summed output of my table data for free in power pages, without paying for eg. PowerBi, and without using any kind of complex code.

If so, why is this code not working, why does it always show “no records found in the table” per the last condition

<div class="row sectionBlockLayout text-start" style="display: flex; flex-wrap: wrap; margin: 0px; min-height: auto; padding: 8px;">
  <div class="container" style="display: flex; flex-wrap: wrap;">
    <div class="col-lg-12 columnBlockLayout" style="flex-grow: 1; display: flex; flex-direction: column; min-width: 250px; padding: 16px; margin: 60px 0px;">
     
      {% assign records = entities.ATestTable1.items %}
     
      {% if records != null and records.size > 0 %}
        <ul>
          {% for record in records %}
            <li>Name: {{ record.Name }}, Weight: {{ record.Weight }}</li>
          {% endfor %}
        </ul>
      {% else %}
        <p>No records found in the table.</p>
      {% endif %}
     
    </div>
  </div>
</div>
 
  • Suggested answer
    Fubar Profile Picture
    Fubar 7,586 on at
    How do I group and sum data without using PowerBi - please help
    This is not valid: entities.ATestTable1.items
    'entities' does not expose a collection of items, but allows you to access specific records by their guid eg. entities.ATestTable1["valid guid"] (but would be more like entities.foo_customtable["valid guid"] as tables would be referenced by their logical schema name & all lower case).
    ​​​​​​​ 
    Generally you would first make a use of the fetchxml tag in Liquid and then process the results of the fetchxml. This link is not exactly what you want but does show how to make use the fetchxml tag and loop the results (ignore all the manifest stuff towards the end of 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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,297

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,890

Leaderboard

Featured topics