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

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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (20,164)