Power Platform
App in a Day
Module 4: Power Automate
Hands-on Lab Step-by-Step
August 2022
Contents
Power Automate ........................................................................................................................................................................1
Lab Prerequisites ............................................................................................................................................................................................................... 1
Exercise 1: Create Approval Request Flow ................................................................................................................................................................ 2
Exercise 2: Conditional Logic ......................................................................................................................................................................................... 9
Exercise 3: Test the cloud flow .................................................................................................................................................................................... 15
Exercise 4: Update the Flow ......................................................................................................................................................................................... 19
Exercise 4: (Optional) Add a Teams Notification ................................................................................................................................................. 25
References ............................................................................................................................................................................... 30
Copyright ................................................................................................................................................................................. 31
Power Platform App in a Day Module 4: Power Automate
Power Automate
Lab Prerequisites
This is the fourth lab in a series covering Power Apps, Microsoft Dataverse, and Power Automate. The assumption is that
you have successfully completed the first three modules, or at least the initial part of setting up an environment as
described in the overview – “00-AppInADay Lab Overview.pdf”.
If you have not completed the previous modules, you can use the partially completed version of the lab package in the
“\Completed\Module3” folder. Follow the instructions in the document “Importing Module 3 Completed” before
proceeding with this module, which will provision the app and the Microsoft Dataverse table into your environment.
Integrating a Power Apps App with Power Automate
In this lab, you will create a flow that uses the Modern Approvals service to automate the approval workflow – it will send
an email to the selected approver and take an action based on their response.
You should already have an app with these two screens:
1|Page ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
Exercise 1: Create Approval Request Flow
The flow will trigger when a new item is added to the Machine Order table in Microsoft Dataverse.
• It will use the Approvals Service to send an approval request.
• The approver will receive an email with options to Approve or Rejects and add comments.
• Once the approver responds, the record in the Machine Order table will be updated with the appropriate approval
status and comments.
• An email will be sent to the requester informing them whether the machine was approved or rejected.
There are two ways to create a flow – from blank or from a template. In this lab, we will create the approval flow
starting with a blank flow.
Task 1: Login on Power Apps website and create a flow
1. Navigate to Make Power Apps and make sure you are in the correct environment.
2. Select Solutions and click to open the Contoso Coffee solution.
3. Click + New and select Automation | Cloud flow | Automated.
Task 2: Configure the trigger
The first thing you will need to configure is the trigger, i.e., when should this flow run. A flow can be triggered:
a. manually from a Power Apps app,
b. manually from a flow button,
c. on a fixed schedule, or
©2020 Microsoft Corporation 2|Page
Power Platform App in a Day Module 4: Power Automate
d. when an event occurs, such as a new item being added to a table, a new email arriving in a user’s inbox, a
new tweet being posted that meets certain conditions, etc.
In this scenario, we will configure the flow to trigger when a new item is added to the Machine Order table in Microsoft
Dataverse
1. Enter a name for your flow, such as – “New machine approval request”
2. In the Choose your flow’s trigger box, search for when a row is added and select When a row is added
modified, or deleted.
3. Click Create.
4. Select Added for Change type
5. Click the Table Name drop-down and select Machine Orders. You can type “machine orders” to search for it.
6. Click the Scope drop-down and select Organization. Scope allows you to limit when your flow will run, for
example you could choose User and it would only run for orders you create. In this case you are choosing
organization because you want this flow to run for records created by anyone in your entire organization.
3|Page ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
Task 3: Add action to send an approval request
1. Click + New step.
2. Search for Approvals and select Start and wait for an approval.
©2020 Microsoft Corporation 4|Page
Power Platform App in a Day Module 4: Power Automate
This will use the approval service. For more information see Get started with approvals.
3. In the Approval type dropdown select Approve/Reject - First to Respond.
4. For the Title, we will add some text and one variable. This variable will contain the Machine Name of the machine
order request. Enter New machine request for in the Title text box.
5. Select Machine Name for the Dynamic content.
Note: if the Dynamic content box is not visible, click the Add dynamic content button -
6. Select the Assigned to field, select click Approver. Click on the Add dynamic content button to show/hide the
dynamic content pane.
5|Page ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
Note: Recall from the earlier lab that this will be the approver’s email address.
7. Click Show Advanced Options.
8. Select the Requestor field and select Requested By
©2020 Microsoft Corporation 6|Page
Power Platform App in a Day Module 4: Power Automate
9. In the Details field, type A new machine has been requested and hit <Enter>.
10. Select Machine Name from the Dynamic content pane.
11. Type , $ and select Price. You may need to click the "See More" option under the dynamic content search bar in
order to see the Price option.
12. Hit Enter and type Department Contribution: $
13. Select Department Contribution.
14. Hit Enter, type Comments: and select Comments.
7|Page ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
15. Your Flow will now look like the image below.
16. Save your flow
Note: When creating your own approval flows, you may additionally include a clickable link that will be displayed in the
approval email. In this scenario, for example, you could include a link to view machine details in an online catalogue. You
would include the Item link and Item link description.
Note: You could also set the Item link to deep link into a Power Apps app to view more details about the request. In this
scenario, you might pass an OrderID or a MachineID as a URL parameter. Power Apps accepts URL parameters.
©2020 Microsoft Corporation 8|Page
Power Platform App in a Day Module 4: Power Automate
Exercise 2: Conditional Logic
In flow, you can add conditions to take different actions depending on a certain result, in this case, whether the request
was approved or rejected.
Task 1: Add conditional logic to flow
1. Click + New step.
2. Search for Condition and select it.
3. Click in the left edit box that says, “Choose a value” and select Outcome from the dynamic content pane. You may
need to press the “+” icon below the edit box to hide the dynamic content pane.
9|Page ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
4. Select is equal to for condition and type Approve for Value.
Task 2: Add conditional logic to flow
We will now configure what actions to perform if the response is approved or not – YES branch vs. NO branch.
We will add two actions:
a. Update the record in the Machine Order table
b. Send an email to the employee who requested the machine
1. In the left If yes box, click Add an action
2. Search for Update a Row and select Update a Row Microsoft Dataverse
©2020 Microsoft Corporation 10 | P a g e
Power Platform App in a Day Module 4: Power Automate
3. Select Machine Orders for Table Name.
4. Click on the Row ID and select Machine Order from the Dynamic content pane.
This is the unique lookup ID for the record (or row) that was created.
5. Click Show advanced options.
6. Select Approve from the Approval Status drop-down.
11 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
7. Select the Approved Date field and select the Expression tab.
8. Type utcNow() and click OK.
9. Save the flow.
Task 3: Add another action
You will now add the send email action to the If Yes branch.
1. From within the yes branch, Click Add an Action.
1. Search for send email and select Send an email (V2) – Office 365 Outlook.
2. Click Sign in if prompted.
©2020 Microsoft Corporation 12 | P a g e
Power Platform App in a Day Module 4: Power Automate
3. Click Accept.
4. Click on the To field and click Switch to Advanced Mode.
5. Select Requested By for To. Select from under the When a record is added action.
6. Type Your machine order has been approved! for Subject.
13 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
7. Click on the Code View button.
8. Set the Body value as shown below:
Your machine has been approved
<b>@{outputs('Update_a_row')?['body/contoso_machinename']}</b></br>
Estimated ship date: @{outputs('Update_a_row')?['body/contoso_estimatedshipdate']}</br>
@{outputs('Start_and_wait_for_an_approval')?['body/responseSummary']}
Select Machine Name and Estimated Ship Date from the When a record is added action.
Note: If you do not have an Office 365 mailbox setup, you can use one of the other connectors to send the email, such as
Outlook.com, Gmail or SendGrid.
9. Click Save.
©2020 Microsoft Corporation 14 | P a g e
Power Platform App in a Day Module 4: Power Automate
Exercise 3: Test the cloud flow
To test the flow, you will:
a. Run the Machine Ordering app and submit an approval request
b. Verify the request was sent to the approver
c. Approve the request
d. Verify that the Microsoft Dataverse record was updated, and an email was sent back to the requestor
Task 1: Test the cloud flow
Note: When a new machine record is added to the Machine Order table in Microsoft Dataverse, it may take up to ten
minutes for the flow to trigger. To ensure the flow runs immediately, select the Test option in the top right and select the
“Manually” option. Then go ahead and submit a machine request. The flow should run immediately.
Note: You may see a warning in the Flow checker that the Power Automate Approvals has not been installed for your
environment. Run the flow to initiate provisioning the Power Automate Approvals.
1. Select Manually and click Save & Test.
2. To submit a machine request, go to Make Power Apps
3. Select Apps and start the Machine Ordering App.
4. Select a few machines and click Compare.
15 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
5. Select one of the machines, provide email for Approver.
6. Provide a comment and click Submit machine request.
7. Click OK.
8. The flow will run and send email to the manager email you provided. The request for approval email will look like
the image below; it will include Machine information, Price, Department Contribution (the calculated field),
and the Requester Comment.
REMINDER: If the flow does not run immediately, please wait, it may take up to ten minutes for the flow to be
triggered. To ensure the flow runs immediately, see note above - select the Test option in the top right and select
the “I’ll perform the trigger action” option. Then go ahead and submit a machine request. The flow should run
immediately. The email, however, may take a few minutes to appear regardless of when the flow starts.
©2020 Microsoft Corporation 16 | P a g e
Power Platform App in a Day Module 4: Power Automate
9. Click Approve.
10. Add a comment and click Submit.
11. The flow will continue to run; it will update the row and send an email to the requestor. The email sent to the
requester will look like the image below.
17 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
12. Check the flow, you will notice that the flow is now marked as Succeeded in the run history.
©2020 Microsoft Corporation 18 | P a g e
Power Platform App in a Day Module 4: Power Automate
Exercise 4: Update the Flow
In this exercise, you will add two actions to the “if no” branch.
Task 1: Add actions
1. If you don’t already have the flow open, open it in edit mode.
2. In the If no branch, click Add an action.
10. Search for Update a Row and select Update a Row (Dataverse)
3. Select Machine Orders for Table Name, select Machine Order for Item ID, and click Show advanced options.
19 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
4. Select Reject for Approval Status.
5. Click Add an action.
6. Search for send email and select Send an email (v2) - Office 365 Outlook.
7. Click on the To field and select Requested By from dynamic content pane.
©2020 Microsoft Corporation 20 | P a g e
Power Platform App in a Day Module 4: Power Automate
8. Enter Your machine was not approved for Subject.
9. Type Sorry, your request for in the body and select Machine name form the dynamic content pane.
10. Type was NOT APPROVED. after the machine name.
11. Select Response summary from the dynamic content pane.
12. The email should now look like the image below.
13. Save the flow.
Task 2: Test the updated Flow
1. Click Test in the top right of the flow editor and start the Flow.
2. 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 Reject this time and enter some
comments, such as “Machine no longer available” Click Submit.
4. Confirm that the requestor receives an email informing them that their machine approval request was rejected.
21 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
5. Navigate to Make Power Apps select Apps and start the Machine Procurement application.
6. Machine Orders will now have the Approval Status.
©2020 Microsoft Corporation 22 | P a g e
Power Platform App in a Day Module 4: Power Automate
Task 3: Visit the approval center
1. Use the Machine Ordering app to submit a few more approval requests.
2. Navigate to Power Automate and make sure you are in the correct environment. Login with your lab credentials if
prompted.
3. Expand Action items and select Approvals.
4. Notice that all pending approval requests are visible.
5. Go ahead and approve or reject a request from this screen. The details are displayed in the right pane where you
can enter comments and Confirm.
23 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
6. The request will no longer be visible as it has been processed.
Note: All approval requests sent to the current logged on user will be visible in the Approvals Center. This includes approvals
sent from any app or flow.
7. You can also use the Approvals Center to view all requests that you have sent and are Awaiting response from
the approver. Select the Sent requests tab at the top to view all requests that you have sent.
8. Open the Power Automate mobile app on your mobile device.
9. Login and switch to the environment where the flow is deployed.
10. Select Approvals in the top right and view all pending approvals.
11. You can quickly approve or reject these pending requests from this screen.
12. If you have push notifications turned on and are signed into the flow mobile app – when you receive a new
Approval request it will trigger a push notification on your phone. You can give this a shot.
Congratulations! You have successfully completed this lab. You have created your Power Apps app and flow and
connected them to a Microsoft Dataverse table. Now you are ready to build your own apps and workflows.
©2020 Microsoft Corporation 24 | P a g e
Power Platform App in a Day Module 4: Power Automate
Exercise 4: (Optional) Add a Teams Notification
In this optional exercise, you will modify the existing flow to include a Teams notification for your approval flow.
Task 1: Modify the Flow
1. Click to expand the Send an email step inside the If yes branch.
2. Click Add an action.
3. Search for post a message and select Post a message in a chat or channel
25 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
4. Select Flow bot for Post as and Chat with Flow Bot for Post in.
5. select Requested By in the Recipient field.
6. In the Message input, type Your machine has been approved and then select Machine Name from under the
Dynamics Content When a record is added… header.
©2020 Microsoft Corporation 26 | P a g e
Power Platform App in a Day Module 4: Power Automate
7. Type Estimated Ship Date: and then select Estimated Ship Date from under the Dynamics Content When a
record is added … header.
8. Click on the … Menu button of the Post a message step and select Copy to my clipboard.
27 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
9. Go to the If no branch and click Add an action.
10. Select My clipboard.
11. Select the step you copied.
12. Click to expand the step you just pasted.
13. Delete the current Message content and change the Message to Your machine request for
14. Place your cursor at the end of the text and select Machine Name from the dynamic content pane. Add was not
approved to the end of the content. The step should now look like the image below.
©2020 Microsoft Corporation 28 | P a g e
Power Platform App in a Day Module 4: Power Automate
15. Click Save to save your changes.
Task 2: Test your modified flow
Now that the flow has been modified, you are ready to test it.
1. Click Test in the top right of the flow editor and select Manually
2. In another tab, navigate to Microsoft Teams.
3. Open a third tab and run the Machine Ordering app -> Select a machine and submit an approval request.
4. You should receive an email with options to Approve or Reject the request. Select Approve.
5. Shortly after hitting submit, you should see a message and a notification in the Chat tab on your app bar –
this is from the Flow Bot. Click to open the chat. Wait a moment if it does not appear immediately.
6. You should see the approval of the request.
29 | P a g e ©2022 Microsoft Corporation
Power Platform App in a Day Module 4: Power Automate
References
App in a Day introduces some of the key functionalities available in Power Apps, Power Automate, Power BI and the
Microsoft Dataverse. For an up to date list of learning references, see Power Apps Resources and Power Automate
Resources.
©2020 Microsoft Corporation 30 | P a g e
Power Platform App in a Day Module 4: Power Automate
Copyright
© 2022 Microsoft Corporation. All rights reserved.
By using this demo/lab, you agree to the following terms:
The technology/functionality described in this demo/lab is provided by Microsoft Corporation for purposes of obtaining
your feedback and to provide you with a learning experience. You may only use the demo/lab to evaluate such technology
features and functionality and provide feedback to Microsoft. You may not use it for any other purpose. You may not
modify, copy, distribute, transmit, display, perform, reproduce, publish, license, create derivative works from, transfer, or
sell this demo/lab or any portion thereof.
COPYING OR REPRODUCTION OF THE DEMO/LAB (OR ANY PORTION OF IT) TO ANY OTHER SERVER OR
LOCATION FOR FURTHER REPRODUCTION OR REDISTRIBUTION IS EXPRESSLY PROHIBITED.
THIS DEMO/LAB PROVIDES CERTAIN SOFTWARE TECHNOLOGY/PRODUCT FEATURES AND FUNCTIONALITY,
INCLUDING POTENTIAL NEW FEATURES AND CONCEPTS, IN A SIMULATED ENVIRONMENT WITHOUT
COMPLEX SET-UP OR INSTALLATION FOR THE PURPOSE DESCRIBED ABOVE. THE TECHNOLOGY/CONCEPTS
REPRESENTED IN THIS DEMO/LAB MAY NOT REPRESENT FULL FEATURE FUNCTIONALITY AND MAY NOT
WORK THE WAY A FINAL VERSION MAY WORK. WE ALSO MAY NOT RELEASE A FINAL VERSION OF SUCH
FEATURES OR CONCEPTS. YOUR EXPERIENCE WITH USING SUCH FEATURES AND FUNCTIONALITY IN A
PHYSICAL ENVIRONMENT MAY ALSO BE DIFFERENT.
FEEDBACK. If you give feedback about the technology features, functionality and/or concepts described in this demo/lab
to Microsoft, you give to Microsoft, without charge, the right to use, share and commercialize your feedback in any way
and for any purpose. You also give to third parties, without charge, any patent rights needed for their products,
technologies and services to use or interface with any specific parts of a Microsoft software or service that includes the
feedback. You will not give feedback that is subject to a license that requires Microsoft to license its software or
documentation to third parties because we include your feedback in them. These rights survive this agreement.
MICROSOFT CORPORATION HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS WITH REGARD TO THE
DEMO/LAB, INCLUDING ALL WARRANTIES AND CONDITIONS OF MERCHANTABILITY, WHETHER EXPRESS,
IMPLIED OR STATUTORY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT.
MICROSOFT DOES NOT MAKE ANY ASSURANCES OR REPRESENTATIONS WITH REGARD TO THE ACCURACY
OF THE RESULTS, OUTPUT THAT DERIVES FROM USE OF DEMO/ LAB, OR SUITABILITY OF THE INFORMATION
CONTAINED IN THE DEMO/LAB FOR ANY PURPOSE.
DISCLAIMER
This demo/lab contains only a portion of new features and enhancements in Microsoft Power Apps. Some of the features
might change in future releases of the product. In this demo/lab, you will learn about some, but not all, new features.
31 | P a g e ©2022 Microsoft Corporation