Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Power Automate flow for adding currency

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi ,

 

I have two entities where entities 1 having currency field, and entity 2 having total amount

so, when i have 5 records with different amounts in that and I need to get the total sum of all record currency in entity 2 field called total amount, please help me on this how i can get using flows.

 

entity 1

currency 100

currency 200

currency 300

currency 100

currency 20

 

entity 2

 

total amount 720

  • Verified answer
    grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Power Automate flow for adding currency

    As an example, I've created the below Dataverse Table with the default Name column and another column called Currency of type number (decimal). The internal name for my Currency column is cra85_currency.

    grantjenkins_0-1669006917780.png

    grantjenkins_1-1669006961912.png

     

    Below is my full flow that will get the sum of all the numbers. I'll go into each of the actions.

    grantjenkins_2-1669007068460.png

     

    List rows retrieves all the data in my Dataverse Table.

    grantjenkins_3-1669007104463.png

     

    We then use a Compose action (I've called it XML) to convert the JSON (body) from List rows to XML so we can use XPath to sum the numbers. This means we don't need to have a loop which makes it much more efficient/cleaner. The expression I use here is below. Effectively it's wrapping the output of List rows into a root element (required for valid XML), then converting to json then xml.

    xml(json(concat('{"root": ', outputs('List_rows')?['body'], '}')))

    grantjenkins_4-1669007283181.png

     

    Total is a Compose action that uses an XPath expression to sum all the numbers. The expression is below. Note that I've used my internal Currency name cra85_currency. You would need to put the internal name of your column here.

    xpath(outputs('XML'), 'sum(//value/cra85_currency/text())')

    grantjenkins_5-1669007377308.png

     

    And that's it. The output of Total is below:

    grantjenkins_6-1669007422550.png

     

    You can then add the total to your other Table.

  • Ashwinreddy Profile Picture
    Microsoft Employee on at
    Re: Power Automate flow for adding currency

    Hi Grantjenkins,

     

    I have created list rows for the output and need to get total sum to another field in different entity,

    I am using the list rows to of both separately.

     

    Trying as below

    Ashwinreddy_0-1669003164398.png

     

  • grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Power Automate flow for adding currency

    Are you able to show the JSON output from your Dataverse table (assuming you're using List rows action)? Specifically, the internal name of your Currency field.

  • Ashwinreddy Profile Picture
    Microsoft Employee on at
    Re: Power Automate flow for adding currency

    Yes it is dataverse used to create entity .

     

  • abm abm Profile Picture
    32,464 Most Valuable Professional on at
    Re: Power Automate flow for adding currency

    Hi @Ashwinreddy 

     

    What's your database? Is it Dataverse?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,535 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,908 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow