Exercise - Create, access and manipulate variables

Completed

In this exercise, you will create a flow that prompts users to enter information about new clients and then register them into an Excel file.

  1. Launch Power Automate for desktop and create a new flow named Client registration.

    Screenshot of the Build a flow dialog.

  2. Deploy a Display input dialog action and populate the Input dialog message field with a message asking for the client's name.

    Screenshot of the Display input dialog action.

  3. Rename the UserInput produced variable to a more descriptive name, such as NameInput. Then Save the action.

    Screenshot of the renamed produced variable in the Display input dialog action.

  4. Repeat the last two steps 3 more times for the last name, the phone number, and the country code, respectively.

    Screenshot of all the Display input dialog actions.

  5. Add a Set variable action in the workspace to join the name and the last name into a new variable called FullName.

    Screenshot of the Set variable action containing the full name.

  6. Repeat the fifth step to join the country code and the phone number into a variable called FullPhoneNumber.

    Screenshot of the Set variable action containing the full phone number.

    Because both variables have been created through a Display input dialog action, they are texts and not numbers. If the variables were numbers, the action above would have performed addition and not string concatenation.

  7. Add a Launch Excel action to open the Excel file containing the clients' information.

    Screenshot of the Launch Excel action properties dialog.

    The file must contain two columns, one for the clients' full name and one for the phone number.

    Screenshot of the structure of the Excel file.

  8. Use the created Excel instance as an input for a Get first free column/row from Excel worksheet action.

    Screenshot of the Get first free column/row from Excel worksheet action.

  9. Deploy a Write to Excel worksheet action and populate the fields with the following values:

    • The Excel instance field with the respective Excel instance variable.
    • The Value to write field with the FullName variable.
    • The Column field with the value 1.
    • The Row field with the FirstFreeRow variable.

    Screenshot of the first Write to Excel worksheet action.

  10. Repeat the previous step, populating the Value to write field with the FullPhoneNumber variable and the Column field with the value 2.

    Screenshot of the second Write to Excel worksheet action.

  11. Lastly, add a Close Excel action to save and close the launched Excel worksheet.

    Screenshot of the Close Excel action dialog.

  12. Now, the flow should resemble the image below. To check that runs as expected, ensure that your Excel worksheet is closed, and then select the Run button in your flow. As you run the flow, you should see the input popups appear on your screen. Continue inputting the information. Once the flow is done you can open the worksheet to ensure that the data was properly recorded.

    Screenshot of the final flow and the Name input.

Congratulations! You know how to use variables in a Power Automate desktop flow!