Exercise - Advanced Power Automate Desktop features

Completed

In this exercise, you use the web automation to convert the total amount into another currency and then add the new conversion to the Excel document.

  1. Open a new web browser and then open Microsoft Edge by going to edge://settings/system, which brings you to the System and performance page. Under the System and performance section, turn off the Continue running background extensions and apps when Microsoft Edge is closed toggle. Then, close all browser tabs and sessions before you proceed.

    Screenshot of clearing the Continue running background extensions and apps when Microsoft Edge is closed toggle in Microsoft Edge.

  2. Open the Power Automate for desktop app and then go to the Enter an invoice flow that you previously created. Select the ellipsis (...) menu to the right of the flow title and then select Edit from the options menu. (You can also select the pencil icon to go directly to the editing view for your flow.)

    Screenshot showing the edit flow button.

  3. From the tabs in the upper part of the screen, select the Subflows dropdown menu. Select New subflow to create a second subflow for the Enter an invoice flow.

    Screenshot showing the create new subflow button.

  4. In the Edit subflow dialog, in the Subflow name field, name your new subflow as Currency_Converter and then select Save.

    Note

    Subflow names can't have spaces. If a space occurs within the name, make sure that you replace the space with an underscore ( _ ).

    Screenshot showing the Edit subflow name dialog.

  5. From the Actions menu to the left of the screen, under the Browser automation folder, double-click the Launch new Microsoft Edge action.

    Screenshot showing the Launch new Microsoft Edge action.

  6. In the Launch new Microsoft Edge dialog, in the Initial URL field, enter the following URL: https://wise.com/us/currency-converter/

  7. Select Save.

    Screenshot showing the initial URL value.

  8. Open a new Microsoft Edge web browser and then go to https://wise.com/us/currency-converter/.

    This website is the one that you use to look up real-time currency conversion rates.

    Screenshot showing the currency converter webpage.

    Next, we enter the total amount value from the AI Builder model as the US dollar (USD) amount into the website input textbox to look up the converted value.

  9. First, let's locate the UI Element on the webpage. Return to the Enter an invoice flow in Power Automate. Ensure that you're viewing the Currency_Converter subflow. From the Actions pane to the left of the screen, under the Browser automation section, expand the Web form filling subfolder.

  10. From the Web form filling subfolder, drag and drop the Populate text field on web page action to below the first action in the design space pane.

    Screenshot showing the Populate text field on web page action.

  11. The Web browser instance is already populated with the %Browser% instance.

    Screenshot showing the Web browser instance.

  12. Identify the textbox UI element on the webpage that takes USD as input. To do so, select the UI element dropdown menu and then select Add UI element.

    Screenshot showing the Populate text field on web page dialog.

  13. A small tracking session window appears to capture UI elements. Open the browser webpage, and a red rectangle appears within the webpage while you hover the mouse cursor over different elements. Move the mouse cursor over the text field that contains the USD value and then use the Ctrl + Left click keyboard shortcut to select the element.

    Screenshot showing a webpage with a red rectangle around an input field.

  14. In the Text field of the dialog, select the variable {X} icon to the right of the field. In the menu, under the Input/output section, double-click the Amount variable.

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

    Screenshot showing the Text field on the Populate text field on web page dialog.

  16. Add another action that sends the previous Total amount input value into the UI element field. From the Actions pane to the left of the screen, expand the Web data extraction subfolder within the Browser automation folder.

  17. Drag and drop the Get details of element on web page action to below the second action in the design space.

    Screenshot showing the Get details of element on web page action.

  18. In the Get details of element on web page dialog, the %Broswer% value is already used to fill in the Web browser instance field. Select the UI element dropdown menu.

  19. From the UI element dropdown menu, select the Add UI element button.

    Screenshot showing the Add UI element button.

  20. Return to the web browser where you convert the USD dollar value. Use the same process as before to select the Output value by using the Ctrl + Left click action on the value.

    Screenshot showing a webpage with a rectangle around an input field.

  21. In the Get details of element on web page dialog, double-click the Variables produced value.

  22. Rename the value to ConvertedAmt.

  23. Select Save.

    Screenshot showing the Get details of element on web page dialog, showing the value renamed.

    Next, let's remove the dollar symbol from the Input Amount variable.

  24. From the right side of your screen, locate and hover the mouse cursor over the Amount variable within the Input/output variables section.

  25. To the right of the variable name, select the ellipsis (...) menu.

    Screenshot showing the More options menu.

  26. From the options menu, select Edit.

  27. Select the Default value field and then delete only the US dollar ($) symbol to the left of the amount value. Select the Save button when you're finished.

    Screenshot showing the Edit input variable dialog.

  28. From the upper toolbar, select the Save button to save all your changes.

  29. Now, you test the subflow. While still viewing the Currency_Converter subflow, right-click the first action.

  30. From the options menu, select Run from here.

    Screenshot showing the Run from here button.

  31. The automation should run and convert the 500 USD amount (the default amount value) into another currency.

    Screenshot showing the currency converter webpage again.

  32. Capture the real-time converted value from the website by going to the Write_notes_into_excel subflow and selecting the tab in the upper part of the screen.

    Screenshot showing the selected tab.

  33. Hover your mouse cursor over and right-click the Write to Excel worksheet action with the Amount value set to column D within the subflow.

  34. From the options menu, select Copy. Then, Paste the new Write to Excel worksheet action below the one in which you copied.

    Note

    If you did not complete the optional task within the previous exercise, then the newly pasted action will be the last action within the subflow. If you did complete the optional task previously, then there will be an additional action at the bottom of the flow labeled Amount and Column F (similar to what is shown within these images).

    Screenshot showing the copy step button.

    Screenshot showing the paste step button.

  35. Hover your mouse cursor over the new Write to Excel worksheet action and then select the ellipsis (...) to the right. From the options menu, select Edit.

    Screenshot showing the edit step button.

  36. From the Write to Excel worksheet dialog, select the variable {X} icon to the right of the Value to write field.

  37. From the menu, under the Flow variables section, double-click the ConvertedAmt variable that you added previously.

    Note

    You might need to delete the previous variable within the field to correctly enter the new variable.

    Screenshot showing the Write to Excel worksheet action dialog.

  38. Select the Column field, and then enter E as the new column.

  39. For the Row field, leave it set to %FirstFreeRow%.

  40. Select Save in the lower right of the dialog.

    Screenshot showing the Write to Excel worksheet action dialog again.

  41. Now, let's add the Currency_Converter subflow into the Main flow, before the Write_notes_into_excel subflow. Return to your Main flow by selecting it from the tabs in the upper part of the screen.

    Screenshot showing the Main flow tab.

  42. From the Actions pane to the left of the screen, within the Flow control folder, drag and drop the Run subflow action into the design space of the Main flow. Place it above the current Run subflow action within the flow.

    Note

    If you completed the optional task within the previous exercise, then you will place the new Run subflow action below the Display message action and above the current Write_notes_into_excel Run subflow action within the flow.

    Screenshot showing the Run subflow action placed after the Set variable action.

  43. In the Run subflow dialog, select the Run subflow dropdown menu. From the list, select Currency_Converter.

  44. Select Save.

    Screenshot showing the Run subflow action dialog.

  45. From the upper toolbar, select the Save button and then wait for the flow to be saved.

    Screenshot showing the save flow button in the upper toolbar.

  46. Now, you can run the Main flow. From the upper toolbar, select the Run button.

After the flow run completes, an entry will be added to the Excel file as it did in the previous exercise, with an extra cell containing the converted value.

Note

If you completed the optional task within the previous lab, then you will see a text entry for the converted value within the Excel file.

Screenshot of the Excel file with the new row and converted value.