1

New to using flows in SP Online so I'm simply trying to add two numbers in one list(parent), using flow, and place that value into another list(child).

Fields are val1 and val2 and they are numeric fields in the parent. The destination field in the child is result and is also a numeric field.

The syntax in the Compose statement is (including quotes):

"@add(item()?['val1'],item()?['val2'])" 

But the update fails. Flow is set to run on newly created items. val1/val2=3.

I copied this syntax from a YouTube video and then tried various combinations to get it to work. They either failed on the save or failed when ran.

The error I'm getting is:

Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2633': 'The template language function 'add' expects its first parameter to be an integer or a decimal number. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#add for usage details.'.

Help with this syntax would be greatly appreciated.

3
  • What is parent and child list? Are they are connected with lookup? or they are in site and subsite? or anything else? Sep 24, 2019 at 5:39
  • You can check for null values before calling @add() method Sep 24, 2019 at 5:46
  • Or if you want your users to always enter the values in these columns then you can make them as required fields. Sep 24, 2019 at 5:55

1 Answer 1

1

The syntax for add function is like below:

add(<summand_1>, <summand_2>)

Where, <summand_1>, <summand_2> should of type Integer, Float, or mixed.

Reference: Flow - add() function.

Solution:

For your case you can use Compose action to enter the Dynamic content of the corresponding SharePoint field and then use add() function to get the sum of these two fields as given below:

enter image description here

Expression:

add(outputs('Compose-ColumnA'),outputs('Compose-ColumnB'))

Reference: Add function with dynamic content.

3
  • Have you tried this? Is it working for you? Sep 24, 2019 at 13:07
  • Your method worked. It's a bit of a strange way of handling adding but hey, it works. Completely different than the video I watched where they wrote the expression like I did above. Thanks very much!
    – Pablo
    Sep 24, 2019 at 13:40
  • Welcome. Glad to hear that it worked for you. Please upvote ( ^ ) and accept it as an answer so that it will be easy for other users to find the correct answers. Sep 24, 2019 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.