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 / How to add 5 variables...
Power Automate
Answered

How to add 5 variables in PowerAutomate

(0) ShareShare
ReportReport
Posted on by 22

Hello,

I have 5 variables named Amount1, Amount2, Amount3, etc...

 

I just want to add all of them up.  I have tried every combination I can think of, but nothing works.  I thought it would be: 

add(Amount1, add(Amount2, add(Amount3, add(Amount4, Amount5))))
 
But I am getting "expression invalid".  This seems like it would be simple, but it doesn't appear to be.
Categories:
I have the same question (0)
  • RobElliott Profile Picture
    10,327 Super User 2025 Season 2 on at

    @Heidi2020 the add expression can only add 2 items so you need to add the result of the first 2 into a compose, then the result of the second 2 into a compose, and then add the Compose controls until you end up with an add of 2 Compose controls.

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

     

  • Verified answer
    efialttes Profile Picture
    14,756 on at

    Hi!

    If you need to add tree variables, you can use the following WDL expression:

     

    add(variables('Amount1'),add(variables('Amount2'),variables('Amount3')))

     

    Same concept applies to 4, 5 and so.

    If you are not familiar with WDL expressions, please follow these steps to add it

    https://flow.microsoft.com/es-es/blog/use-expressions-in-actions/

    Flow_add3orMore.png

    Hope this helps

  • Heidi2020 Profile Picture
    22 on at

    Thank you so much. This worked like a charm.

  • efialttes Profile Picture
    14,756 on at

    Thanx for marking this topic as solved, @Heidi2020 ! THis way others facing a similar problem can find a solution faster.

     

    Please also note you can even select several responses as solution, even from different community members!

     

    Flow_AcceptSolution.png

    I mean, I believe @RobElliott is also a valid approach

    Thanx for helping to make this community great!

     

  • Heidi2020 Profile Picture
    22 on at

    Thank you for the suggestion.  I tried the second approach below because it seemed like less steps.  But looks like this could work as well.  I appreciate the response!

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard