Define variables
This article explains how to define variables, which you can use to hold and output values in a flow.
Details of the “Set variable” action
Section titled “Details of the “Set variable” action”This article uses the “Set variable” action.
The action has the following parameters.
| Parameter | Value |
|---|---|
| Variable | The name of the variable to create |
| Value | The value to store in the variable |

Implement by copying and pasting
Section titled “Implement by copying and pasting”As a sample, this article uses a flow that defines two variables: a string and a number.
Copy the following code and paste it into the Power Automate Desktop flow designer to add the actions.
SET VarNumber TO 15000SET VarString TO $'''Hello'''Implement in Power Automate Desktop
Section titled “Implement in Power Automate Desktop”-
In “Search actions”, type “Set variable”.
-
Set the parameters as follows.
Parameter Value Variable %VarString% Value Hello -
When you run the flow, a variable is defined that you can use to hold and output values in the flow.
Possible exceptions
Section titled “Possible exceptions”Errors can occur when you define the variable if the syntax is wrong, but this action doesn’t throw exceptions while the flow is running.
You don’t need to set up error handling with an “On block error” block.