Define an input variable

Completed

Variables allow information to change, or be variable, for every run of your flow. If you're using a flow for any type of data entry, you need variables to define the fields that you need to enter. Input variables include information that you enter into the flow before or during the run. Output variables are outcomes that the flow returns to you after the run. Power Automate for desktop provides you with the ability to receive input values from cloud flows and return values by using output variables. As a result, your automations can be seamlessly integrated. To define input variables, begin in your Power Automate for desktop app and then open the designer by editing a desktop flow.

Watch the following demo video of the steps that you complete in this unit.

Note

The flow in the demo video was built in the Build your first Power Automate desktop flow module.

Screenshot of the Flows section in Power Automate for desktop with the Edit icon highlighted.

When you're in the designer, select the plus (+) icon under the Input/output variables section, and then select Input.

Screenshot of Actions in Power Automate for desktop, with Variables selected and the plus sign icon selected to reveal the Input and Output options.

The Variable type can be Input or Output. This example uses input; output variables are covered later. The Variable name is used and referenced inside the desktop flow. The External name is used outside the desktop flow, and the Description field gives you more information on the variable, which can be especially helpful if you have many different input and output variables in the same desktop flow. The Default value allows you to define a value if no input is provided. The Data type field helps to further define your variable and how Power Automate handles it. For example, using the data type of Sensitive text encrypts the values, which helps offer security on sensitive data. You can use this data type for passwords to open secure programs or for other personal or private information. You can set your own values for your variable, or you can use the values that are displayed in the following screenshot. Select Create to finish your variable.

Screenshot of the Add a new input variable dialog.

Continue to select the plus (+) icon and then create more input variables for your flow. If you're using the desktop flow that's built on the Contoso Invoicing app, define two more variables based on the following values.

Variable 2:

  • Variable type - Input

  • Variable name - Contact

  • Data type - Text

  • Default value - b.Friday@wingtiptoys.com

  • External name - Contact email

  • Description - Contact email

Variable 3:

  • Variable type - Input

  • Variable name - Account

  • Data type - Text

  • Default value - WingTip Toys

  • External name - Account Name

  • Description - Name of the account that's being invoiced

After you finish defining your input variables, select Save.

Screenshot of Power Automate for desktop Actions page with the Save button highlighted.

Now that you defined the input variables, you can set their use in the desktop flow.