Power Automate add() Function

Do you want to learn how to use the Power Automate add() function? Yes, then you are at the right place.

This Power Automate tutorial explains the add() function in Power Automate, its syntax, and its uses.

Moreover, we will discuss how to use the Power Automate Add Function in the SharePoint List with a simple example.

Power Automate add() function performs addition on numerical values. It takes two parameters and returns the sum of those values. Also, it can handle different numeric data types, including integers and floating-point numbers.

Power Automate add() Function

The Power Automate add function returns the result obtained by adding two parameters.

The add() function extracts the sum of two parameters from the given variables. This can be utilized with variable inputs like integer, float, or mixed.

Here, I have given inputs like:

  • Cost of Item= 1872.20
  • Delivery Cost= 32

Output after calculation= 1904.2

Add() function expression in Power Automate

This is a brief introduction to the Power Automate add() function.

Power Automate add() Function Syntax

The Power Automate add() function syntax will look as mentioned below.

add(<summand_1>, <summand_2>)

Parameters:

summand_1 (mandatory): The first number to add to the second.
summand_2 (mandatory): The second number to add to the first.

It will return the sum of the given number.

Power Automate add() Number Variables

Here, I will show you how to use a manual trigger to use the add function in Power Automate. To achieve this, follow the steps below.

Example:

The Product Cost is “1872.20” and the Delivery Cost is 32. Then, the Power Automate add() function result will return the value by adding both values [1904.2].

How to use add() expression in Power Automate

To achieve this, follow the below-given steps:

1. Open the Power Automate home page in your browser, click on + Create -> Select the Instant cloud flow -> Enter the flow name, and choose the trigger’s flow (Manually trigger the flow).

  • I have added two Numbers as input in this trigger, as shown below.

2. To create and set the initial value of a variable within your flow, add the ‘Initialize variable’ flow action and set the required details.

  • Name: Set the name for the variable Total Cost.
  • Type: Select the type of variable as Array.
  • Value: Here, I have given no value as shown below.
How to use Power Automate add() function expression

3. Next, add the ‘Initialize variable’ to create and set the initial value of a variable within your flow and set all the details.

  • Name: Provide the name of the initialized variable.
  • Type: Select the type of variable as Float.
  • Value: Here, I have given the expression as mentioned.
add(triggerBody()['number'],triggerBody()['number_1'])

After the expression, Click OK.

How to use Power Automate add expression

4. Add the ‘Compose’ flow action and provide the initialized variable flow action output from dynamic content.

Inputs: Select the field -> Take variable from dynamic content.

How to use add function expression in Power Automate

5. Now, it’s time to Save and Test. Click on Test and test it Manually -> Inside the Run flow tab, provide the values, then click Run flow as shown below.

Power Automate use add function expression using SharePoint list

6. The compose flow action will display the output after calculating the two parameters, as shown below.

  • The return output will be 1904.2.
Power Automate add() function expression format

This is how to use the add function in Power Automate using a manual trigger flow.

Power Automate Add Function in SharePoint List

Here, we will see how to use the Power Automate Add Function in a SharePoint List.

Example:

I have taken a SharePoint list [Employee Expenses] with two number columns named Food Expenses and Logging Expenses.

This list has various items and a number column, as shown below.

In this scenario, I want to know the total expense of an employee by calculating two SharePoint columns [Food Expenses + Logging Expenses = Total Expenses].

How to use add function in Power Automate

To achieve this, I have made a Power Automate cloud flow and used the add() function to update items in the SharePoint column.

To work around this, follow the steps below.

1. Browser Power Automate to open the home page, click on + Create -> Select the Automated cloud flow -> Provide the flow name and choose the trigger’s flow (When an item is created and modified).

  • Site Address: Select a SharePoint site address from the drop-down.
  • List Name: Choose a specific SharePoint list.
How to use add() function format in Power Automate

2. To filter items based on condition while retrieving items from the SharePoint list, add the ‘Get item’ flow action and set the details.

  • Site Address: Provide the SharePoint site address.
  • List Name: Select the name of the SharePoint List.
  • Id: I have given a SharePoint item’s ID (1).
How to use add function in Power Automate using SharePoint

3. Next, add the ‘Compose’ flow action and enter the expression to add the two sharePoint columns.

Inputs: Select field -> Click Expression -> Insert the code below.

add(triggerOutputs()?['body/FoodExpense'],triggerOutputs()?['body/LoggingExpense'])

Then Click OK.

where add two values obtained from the outputs of a trigger.

Power Automate add() expression using SharePoint

4. To modify or update existing items in the SharePoint list, add the ‘Update item’ flow action and set the required fields.

  • Site Address: Provide the SharePoint site address.
  • List Name: Select the name of the SharePoint List.
  • Id: Here, I have given 1 as SharePoint item ID.
  • Total Expenses: I have selected the Outputs of the Compose action from dynamic content.
How to use add function using SharePoint in Power Automate

5. Now click on Save and Test. Test it Manually and click on Run flow. Then, open the SharePoint list, displaying the output after calculating and updating the SharePoint column, as shown below.

How to use Add function in Power Automate using SharePoint List

This is how to use the add function to add SharePoint list columns in a Power Automate flow.

Conclusion

I hope this Power Automate tutorial taught you how to use the add() function in Power Automate. Moreover:

  • How to use the add() function in Power Automate
  • Power Automate Add() Function in SharePoint List

Also, you may like some more Power Automate tutorials: