cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

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
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (9,182)