web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Unable to add sum more...
Power Automate
Answered

Unable to add sum more than 2 values using add expression

(0) ShareShare
ReportReport
Posted on by 391

Hi everyone,

 

In "Word Online Business" action, I am using the fx expression to sum the values of the other columns. However, it won't work if there are more than 2 values. Is there a workaround to it?

 

If I get rid of the 3rd if statement, it will work.

add(
 if(contains(body('Select_-_OptionalUpgrades'), 'Zip Tap'),
 variables('ZipTap'),
 0
 ),
 if(contains(body('Select_-_OptionalUpgrades'), 'V-Zug Combi Steam Oven'),
 variables('V-ZugCombi'),
 0
 )
 ,
 if(contains(body('Select_-_OptionalUpgrades'), 'V-Zug Warming Drawer'),
 variables('V-ZugWarming'),
 0
 )
)


Error:

Unable to process template language expressions in action 'Populate_a_Microsoft_Word_template' inputs at line '0' and column '0': 'The template language function 'add' expects two numeric parameters: the first summand as the first parameter and the seccond summand as the second parameter. The function was invoked with '3' parameter(s). Please see https://aka.ms/logicexpressions#add for usage details.'.

Categories:
  • Verified answer
    v-mingkz-msft Profile Picture
    Microsoft Employee on at

    Hi @nicklim,

    The add function just except 2 parameters.

    You can use two add.

    add(
    add(
     if(contains(body('Select_-_OptionalUpgrades'), 'Zip Tap'),
     variables('ZipTap'),
     0
     ),
     if(contains(body('Select_-_OptionalUpgrades'), 'V-Zug Combi Steam Oven'),
     variables('V-ZugCombi'),
     0
     )
    ),
     if(contains(body('Select_-_OptionalUpgrades'), 'V-Zug Warming Drawer'),
     variables('V-ZugWarming'),
     0
    )

     

    Best Regards,

    Kyrie

  • nicklim Profile Picture
    391 on at

    @v-mingkz-msft 

     

    Thanks for the prompt reply and you might want to edit your code as you are missing a closing bracket.

  • nicklim Profile Picture
    391 on at

    @v-mingkz-msft  sorry to bug you, I've added additional add function into the code but it seems to not like it. Am not sure if that's the way to do it? Can you have a look at it please.

     

    add(
    	add(
    		if(contains(body('Select_-_OptionalUpgrades'), 'Zip Tap'),
    			variables('ZipTap'),
    			0
    		),
    		if(contains(body('Select_-_OptionalUpgrades'), 'V-Zug Combi Steam Oven'),
    			variables('V-ZugCombi'),
    			0
    		)
    	),
    	add(
    		if(contains(body('Select_-_OptionalUpgrades'), 'V-Zug Warming Drawer'),
    			variables('V-ZugWarming'),
    			0
    		),
    		if(contains(body('Select_-_OptionalUpgrades'), 'Pearl Finish'),
    			variables('V-ZugWarming'),
    			0
    		)
    	),
    	add(
    		if(contains(body('Select_-_OptionalUpgrades'), 'Electric opener'),
    			variables('ElectricOpener'),
    			0
    		),
    		if(contains(body('Select_-_OptionalUpgrades'), 'Under Bench wine fridge'),
    			variables('UnderBenchWine'),
    			0
    		)
    	),
    		if(contains(body('Select_-_OptionalUpgrades'), 'Tall Wine Fridge'),
    			variables('TallWineFridge'),
    			0
    		)
    )

      

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 445

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 300

Last 30 days Overall leaderboard