Optional exercise - Add a Teams notification

Completed

In this optional exercise, you modify the existing flow to include a Microsoft Teams notification for your approval flow.

Note

To complete the exercises, you'll need to use a few files. Download the App in a Day files for use in this module. The file folders that are in this download include:

  • Completed modules with instructions - Package files to import the completed exercise steps.
  • Machine-Order-Data.xlsx - File used in the exercises.

Section 1: Modify the flow

Before you begin, ensure that you're currently viewing the New machine approval request cloud flow, within the Contoso Coffee solution, in Edit mode.

To modify the flow, follow these steps:

  1. In the True branch of the condition, select the + icon after the Send an email action to open the Add an action pane.

    Screenshot showing the Send an email (V2) step in the If yes branch.

  2. Search for post a message and select Post a message in a chat or channel. You might be prompted to sign in.

    Screenshot with a box around the Post message in a chat or channel (Microsoft Teams) option in the choose an action menu.

    Note

    You may need to sign in to create a connection to Microsoft Teams. Select the Sign in button to form this connection.

  3. Select Flow bot from the Post as dropdown menu, and then select Chat with Flow bot from the Post in dropdown menu.

    Screenshot with Flow bot selected from the Post as menu and Chat with a Flow bot selected from the Post in menu.

  4. Switch to Advanced Mode, select the Recipient field, and open the dynamic content pane by selecting the lightning bolt icon.

  5. Select Requested By under When a row is added... in the Recipient field.

    Screenshot showing the Recipient field where the Requested By block should be inserted.

  6. In the Message box, type Your machine has been approved and then select Machine Name from under the dynamic content When a row is added... header.

    Screenshot with a box around the Machine Name dynamic content to be inserted.

  7. Move to the next line of the message, then type Estimated Ship Date: and then select Estimated Ship Date from under the dynamic content Update a row header. Important to make sure you select the Estimated Ship Date from the Update a row action.

    Screenshot showing the message field where the Estimated Ship Date block should be placed.

  8. In the False branch of the condition, select the + icon after the Send an email action to open the Add an action pane.

    Screenshot showing copy to my clibpboard.

  9. Search for post a message and select Post a message in a chat or channel.

    Screenshot with a box around the Post message in a chat or channel (Microsoft Teams) option in the choose an action menu.

  10. Select Flow bot from the Post as dropdown menu, and then select Chat with Flow bot from the Post in dropdown menu.

    Screenshot with Flow bot selected from the Post as menu and Chat with a Flow bot selected from the Post in menu.

  11. Switch to Advanced Mode, select the Recipient field, and open the dynamic content pane by selecting the lightning bolt icon.

  12. Select Requested By under When a row is added... in the Recipient field.

    Screenshot showing the Recipient field where the Requested By block should be inserted.

  13. In the Message box, type Your machine request for and then select Machine Name from under the dynamic content When a row is added... header, then type was not approved.

    Screenshot with a box around the text Your machine request for Machine Name dynamic content was not approved.

  14. Select Save to save your changes.

Section 2: Test your modified flow

Now that the flow is modified, you're ready to test it.

  1. In another tab, go to Microsoft Teams.

  2. Open a third tab and run the Machine Ordering app. Select a machine and submit an approval request.

  3. You should receive an email with options to approve or reject the request. Select Approve.

  4. After you select Submit, a message and a notification should display in the Chat tab on your app bar from the flow bot. Select to open the chat. Wait a moment if it doesn't appear immediately.

    The approval of the request should be visible.

    Screenshot of the approved machine request.