B.3 ‐ Robotic Process Automation Online Workshop ‐ Power Automate desktop flow Part 2 - dcasota/m365-scripts GitHub Wiki

With the import of the reference solution, as described in https://learn.microsoft.com/en-us/training/modules/use-input-output-online-workshop/exercise-import, open the imported solution.

Click on desktop flows.

image

Open the Enter an invoice desktop flow. Select Edit. In the Power Automate Desktop dialog, select Launch app.

image

Within the Input/output variables section to the right of the screen, in the Variables pane, select the plus (+) icon and then select Input from the options list to add your first input.

image

In the New input variable dialog, use these values to set up the first input variable:

Variable name - Amount
Data type - Text
Default value - $500
External name - Amount
Description - Amount

Select the Save button in the lower part of the dialog.

image

Repeat the previous steps to add a second input variable. This time, use the following values to set up the second input variable:

Variable name - Contact
Data type - Text
Default value - [email protected]
External name - Contact
Description - Contact email

image

Repeat the previous steps again to create a third input variable. Use the information and these values to fill in the variables within the new, third input and then select Save.

Variable name - Account
Data type - Text
Default value - WingTip Cups
External name - Account Name
Description - Account Name

image

After you've added and saved all three input variables, select the Save button in the upper part of the screen to save changes that you've made within the module so far.

image

To the right of the screen, in the Variables pane, in the Input/output variables section, select the plus (+) icon and then select the Output option to add your first output variable.

image

Use the following values to set up the first output variable, and click save.

Variable name - InvoiceID
Data type - Text
External name - InvoiceID
Description - InvoiceID

Add an action to set this output. Ensure that the Invoicing application is still running. Select step 10: End of autogenerated actions using the recorder. Go to the Actions pane, search for get details, and then double-click to add Get details of the UI element in window.

image

In the Get details of the UI element in window dialog, select the UI element dropdown menu and then select Add UI element.

After you've selected the Add UI element option, a red rectangle will appear on the screen while you hover the mouse cursor over the different elements.

image

Go to the Invoicing app. On the Invoice Detail tab, move the mouse cursor over the number in the ID field. Press and hold the Ctrl key on your keyboard and then select the ID number.

A different ID number might appear than what's shown in this exercise.

Return to the dialog and select Save. Your UI element might appear differently than what's shown in the following figure.

image

Select the new step that you added.

Next, set the InvoiceID output variable, which will allow you to use the Invoice ID in downstream processes or from your cloud flow in a future module.

Go to the Actions pane, search for set variable, and then double-click to add the Set variable action.

image

Select NewVar next to Variable and select the {x} button to pull up the variable menu and specify InvoiceID.

image

Select the {x} button in the Value section and double-click AttributeValue from the list.

image

Select the Save button in the lower part of the Set variable dialog.

Set up the steps to use input variable values when you're running the automation. Select step 5: Edit 'TextBox' with 'WingTip Cups', and then on the right, select the ellipsis (...) menu. From the options menu, select Edit.

image

In the Populate text field in window dialog, delete the value in the Text to fill-in field.

Select the Account variable (one of the input variables that you previously created) by selecting the {x} icon and then double-clicking to select Account.

image

Select Save.

image

Repeat the previous steps to change the value of Text to fill-in in the appropriate steps in the desktop flow.

Use the Contact input variable for the appropriate step.

Use the Amount input variable for the appropriate step.

When you've finished, your actions should resemble the following figure.

image

Select the Save icon to save all your changes.

Now, you've completed the process of setting up and using inputs and outputs in your desktop flow. In the next modules, you'll use those inputs and outputs to pass data values between cloud flows and desktop flows. Next, you can test your flow by selecting the Run icon in the lower part of your screen and then watch the automation run by using the input variable values (default values).

Close the Power Automate for desktop application.