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 Automate / Get unique values from...
Power Automate
Unanswered

Get unique values from a Sharepoint list and update them in another SP list with sum function

(0) ShareShare
ReportReport
Posted on by

Hello,

 

Hope someone can help me with this.

I have a large SP List (SALES_DETAIL) with clients and sales of different products:

ClientIDBrandAmount_Sold
A1XX12
A1FF4
B1XX5
B1ZZ6

 

Since this list is huge, >20.000 rows, when working in PowerApps, even with pre-filtering it takes some time to display data.

I need to have a secondary list, to just have the ClientID (retrieving unique values from SALES_DETAIL) and the sum of "Amount_Sold), for simpler display in PowerApps.

 

ClientIDTotal_Amount
A116
B111

 

Tried several approaches using group and list view on a flow but can't get quite there.

 

Any help appreciated!

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

    You just need one Select action (and xpath):

     

    Chriddle_0-1686930751452.png

    From:

    union(
    	xpath(
    		xml(json(concat('{"root":{"item":', outputs('Data'),'}}'))),
    		'//ClientID/text()'
    	),
    	json('[]')
    )

    Map:

    ClientID

    item()

    Amount

    xpath(
    	xml(json(concat('{"root":{"item":', outputs('Data'),'}}'))),
    	concat('sum(//item[ClientID = ''',item(),''']/Amount_Sold)')
    )

     

    Result:

    [
     {
     "ClientID": "A1",
     "Amount": 16
     },
     {
     "ClientID": "B1",
     "Amount": 11
     }
    ]

     

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard