Exercise - Create, access and manipulate variables

Completed

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

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

    Screenshot of the Build a flow dialog.

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

    Screenshot of the Display input dialog action.

  3. Rename the UserInput 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 three 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 you created both variables through a Display input dialog action, they're texts and not numbers. If the variables were numbers, the action above would perform 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 enter 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, entering 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 following image. To check that it 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 see the input popups appear on your screen. Continue inputting the information. When the flow finishes, 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.