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 Automate
Unanswered

Calculating Sum

(0) ShareShare
ReportReport
Posted on by 42

Having a little trouble getting a final feature to work on my automate flow.  I have a Microsoft Form that populates a SharePoint list.  My form asks users if they will require a software in the coming year.  If they do, a running total is calculated based on the price of the software. 

For example:

"Will you require Photoshop?"

Yes/$1500

"Will you require Creative Cloud?"

Yes/$500

"Will you require Office 365?"

Yes/$2000

"Will you require Chrome?"

Yes/$1000

 

If a user chooses yes, I'd like to simply add all values and update the SharePoint column with the total cost.  

 

I'm having an issue in my compose function, however.  I'm trying to use this as my calculation: 

 

add(var1, add(var2, add(var3, add(var4, var5))))

 

My variables were initialized as integers, but I'm getting the below error:

 

The runtime value '"add(var1, add(var2, add(var3, add(var4, var5))))"' to be converted doesn't have the expected format 'Number/double'.


Here's my flow

 

RenewCosts.PNG

 

Any suggestions would be appreciated!

Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    Can you try the following:

     

    add(variables('var1'), add(variables('var2'), add(variables('var3'), add(variables('var4'), variables('var5')))))

     

  • Mario69 Profile Picture
    42 on at

    Thanks for the response @grantjenkins .  I've tried your suggestion, but I'm still getting an error on my format.  

    The runtime value '"add(variables('var1'), add(variables('var2'), add(variables('var3'), add(variables('var4'),variables('var5')))))"' to be converted doesn't have the expected format 'Number/double'.

     

    add(variables('var1'), add(variables('var2'), add(variables('var3'), add(variables('var4'),variables('var5'))))).

     

    Also, should I be calling my 'Total' compose at any point?  

  • grantjenkins Profile Picture
    11,063 Moderator on at

    Are you able to show a screenshot of your actual expression? Also, what you are putting in the other actions to get a better idea of where the issue is?

  • Mario69 Profile Picture
    42 on at

    Automate.PNG

    @grantjenkins Let me know if you'd like me to expand any other sections.  

  • Mario69 Profile Picture
    42 on at

    Mario69_0-1698956058881.png

    Here's an example of one of my variables.  I've tried using string and integer as my type but no success

  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    It might be just how you are accessing your variables. To access the variable show in your screenshot you would use:

     

    //Instead of
    variables('var2')
    
    //You should use
    variables('Revit')
  • Mario69 Profile Picture
    42 on at

    Yes sir.  That was my issue.  Thanks @grantjenkins 

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard