cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sudosaurus
Post Partisan
Post Partisan

Calculating costs with 'Add' expression - InvalidTemplate. Unable to process template language expressions in action 'Update_item' inputs at line '1' and column '11294':

Hello,

 

I have a SharePoint list where I have four currency columns (Venue Costs, Food/Drink Costs, Staff Costs and Misc Costs.)

list-costs.png

I also have a 'Total Costs' currency column which Id like to display the total of the four costs above.

 

I have setup a flow to do this and have used the Add expression and added my dynamic columns:

add(triggerOutputs()?['body/VenueHire'],triggerOutputs()?['body/FoodRefreshments'],triggerOutputs()?['body/StaffCosts'],triggerOutputs()?['body/MiscCosts'])

 

When the flow is run, it fails on the 'Update Item' step with this error:

InvalidTemplate. Unable to process template language expressions in action 'Update_item' inputs at line '1' and column '11294': '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 '4' parameter(s). Please see https://aka.ms/logicexpressions#add for usage details.'.

voicevine-costs.png
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @sudosaurus

 

Add() function only support put two parameters into it, so, if you want to sum 4 numbers, you should tweak your expression as below:

add(add(triggerOutputs()?['body/VenueHire'],triggerOutputs()?['body/FoodRefreshments']),add(triggerOutputs()?['body/StaffCosts'],triggerOutputs()?['body/MiscCosts']))

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
ManishJain
Solution Sage
Solution Sage

Hi @sudosaurus ,

 

Can you please add compose action for all 4 values that you are getting from sharepoint and do the summation of all 4 compose actions. I see currency symbol and suspect it is pulling up raw value (including currency) and not formatted . 

 

Thanks

Apologies, I am still relatively new to Power Automate. Could you advise how I would do this as a compose action?

Hi @sudosaurus ,

 

Click on Add an action and start typing Compose , under data operation you will see "Compose" under actions. 

Once you get that click on inputs and specify your expression in that dialog. 

Capture.JPG

 

Thanks

Didn't appear to work for me:

 

ComposeFail.png

Hi @sudosaurus

 

Add() function only support put two parameters into it, so, if you want to sum 4 numbers, you should tweak your expression as below:

add(add(triggerOutputs()?['body/VenueHire'],triggerOutputs()?['body/FoodRefreshments']),add(triggerOutputs()?['body/StaffCosts'],triggerOutputs()?['body/MiscCosts']))

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (3,234)