Exercise - Use Microsoft Teams to get approvals

Completed

In this exercise, you'll Use Microsoft Teams to get approvals.

  1. Open a new web browser and go to Power Automate. Sign in if needed.

  2. Select Solutions from the left menu and then open the Invoice processing solution First Last.

    Screenshot showing the Invoice processing solution.

  3. Open the Enter invoice information flow that you created.

    Screenshot showing the Enter invoice information flow.

  4. From the toolbar, select the Edit button.

    Screenshot showing the edit button.

  5. Expand the Apply to each box. Select the Send an email (V2) action, and after the parameters box pops up, select the ellipsis (...) and select Delete from the options menu.

    Screenshot showing the delete flow step button.

  6. In the Delete Step dialog, select OK.

  7. Below the Extract information from documents action, select Add an action.

    Screenshot showing the add action step button.

  8. In the search bar for the new action, search for Teams post a choice. From the search bar above the Actions list, then select Post a choice of options as the Flow bot to a user under the first Microsoft Teams set of actions.

    Screenshot showing the search action step.

    Important

    You can take the next actions after following one of two approaches. In one approach, you can use a simple method that requires the Post a choice of options as the Flow bot to a user action. A richer, more innovative approach requires the Post an Adaptive Card and wait for a response action that uses the Adaptive Cards technology from Microsoft.

    Note

    If you want to learn about the more advanced Adaptive Cards approach instead of using the basic approach, see the Exercise - Advanced Power Automate Desktop features unit near the end of the next module in this learning path. Otherwise, continue with the following steps.

  9. A Create connection reference box will pop up only giving the option to sign-in. Select sign-in and use the same account as you've been previously using in the lab.

    Screenshot showing the sign-in step button.

  10. In the Options Item - 1 box, enter Yes.

  11. Select Add new item. In the Options Item - 2 box, enter No. Then select Show all to see all of the parameters.

  12. Use the following values to fill in the information for the Recipient, Message, and Headline boxes. Find the values for the Message field by searching for them within the Dynamic content pane (the blue lightning bolt button):

    Recipient - Your username

    Message - We've received an invoice in the amount of Total value (from dynamic content under the AI Builder action), on the date Date value (from dynamic content under the AI Builder action). The contact person is Contact value (from dynamic content under the AI Builder action). Would you like to approve this?

    Headline - Please approve this invoice.

    Screenshot showing the Post a choice of options step.

  13. Add a branch into your flow so that the automation will perform different action paths based on different approval return results. Select Add an action.

    Screenshot showing the add an action step.

  14. In the search bar, search for condition. From the Actions tab, select Condition.

    Screenshot showing the condition.

  15. In the Choose a value field, select selectedOption (from dynamic content, under the previous action of Post a choice of options as the Flow bot to a user).

    Screenshot showing the condition value.

  16. In the Choose a value field, enter the value of Yes.

    Screenshot showing the final condition.

  17. Navigate back to the flow model and select the + sign under True. Then select Add an action in order to add an action.

    Screenshot showing the Add an action button of the If yes branch.

  18. In the Add an action dialogue pane, select the search bar and type in run a flow. Then select the Run a flow built with Power Automate for desktop action located under Desktop flows.

    Screenshot showing the Add an action run flow.

  19. Select Enter an invoice from the drop-down menu in the Desktop Flow field. Next, select Attended (runs when you're signed in) from the drop-down menu in the Run Mode field.

    Screenshot showing the parameters.

  20. The Run a flow step should be added. Select the + sign and Add an action to add another action to the flow.

    Screenshot showing the add another action button.

  21. Within the search bar, search for reply to email. Then, select the Reply to email (V3) action under the Office 365 Outlook group on the list.

    Screenshot showing the reply to email button.

  22. Use the following information and value to fill in the fields within the new action.

    • Message ID - Message ID (from dynamic content for the When a new email arrives (V3) action)
  23. Select Show advanced options.

    • Body - Your invoice of amount Total value (from dynamic content under the AI Builder action) is approved.
  24. In the Subject field, enter Your invoice is approved.

    Screenshot showing more parameters.

  25. Collapse the actions in the If yes branch by selecting the titles of the actions.

    Next, create the steps for the case if the approval result was No.

  26. Select Add an action under the False branch.

    Screenshot showing the Add an action button of the If no branch.

  27. Within the search bar, search for reply to email. Then, select the Reply to email (V3) action under the Office 365 Outlook group on the list.

    Screenshot showing the reply to email action.

  28. Use the following values and information to fill in the fields in the newly added action. Use the Dynamic content pane to search for specific values that are needed for some fields.

    • Message ID - Message ID (from dynamic content for the When a new email arrives (V3) action)
  29. Select Show advanced options.

    • Body - Your invoice of amount Total value (from dynamic content from the AI Builder action) was rejected.
  30. In the Subject field, enter Your invoice is rejected.

    Screenshot showing the invoice rejected.

  31. From the toolbar, in the upper-right corner, select Save. Then, select Test.

    Screenshot showing the test flow button.

  32. On the Test Flow pane, select Manually > Test.

  33. In a separate web browser tab, open the Microsoft Teams app (browser version, not desktop) and then sign in by using the same test account. You can find the web version of Microsoft Teams by going to https://teams.microsoft.com.

  34. In another separate web browser tab, open the Office 365 Outlook app. You can find the web version of Microsoft Outlook by going to https://outlook.office.com/mail.

  35. In Outlook, compose a new email with the following settings:

    • To - (email address of the user identity that you're using in this module)

    • Subject - New invoice

    • Attachments - new-invoice.jpg (from the module resource files)

    Screenshot of the email that will trigger the flow.

  36. Send the email and then wait for the flow to run.

  37. Wait for an approval request Adaptive Card to appear in the Teams tab. Select Yes or No, and then select Submit to approve or reject the invoice as desired.

    Screenshot of Microsoft Teams card approval request.

  38. On the Outlook tab, check for a confirmation email that matches the option that you selected.

    Screenshot showing the email that was sent by Power Automate.

  39. Repeat the test by using the other test case (accept or reject).

  40. Similar to previous modules, you can monitor the run status from the flow details page and run details page. Return to the Enter invoice information flow. Your flow should have run successfully.