Practice Lab 4.1 – Build a canvas app
Scenario
You are a Power Platform functional consultant and have been assigned to the Fabrikam project for the next stage of the project.
You have been assigned to continue work on the Fabrikam Environmental Work Delivery canvas app.
In this practice lab, you will examine the app to see how it works, make some user interface changes, and call a Power Automate cloud flow.
Exercise 1 – Examine the canvas app
In this exercise, you will learn about the canvas app.
Task 1.1 - Run the app
-
Navigate to the Power Apps Maker portal https://make.powerapps.com.
-
Make sure you are in your Practice environment.
-
Select Solutions.
-
Click to open the Fabrikam Environmental solution.
-
In the Objects pane on the left, select Apps.
-
Select the Environmental Work Delivery app, click on the ellipses (…), and select Play.
-
Sign in with your Microsoft 365 credentials if prompted.
-
The app has 4 screens which are navigated using the left-hand navigation bar:
- Home: Contains three tiles that show the count of Projects, Milestones, and Outcomes.
- Projects: Create and edit Projects
- Milestones: Set Percentage Complete on Milestones
- Outcomes: Update the details of Outcomes
-
Note that the label for Outcomes is incorrect. This is an issue your client, Fabrikam, has raised that needs to be fixed.
-
Select the Projects screen (second icon).
-
Note that Type is blank for existing projects.
-
Note that the colors for the drop down controls are blue.
-
Click the + icon. A new Project row is added.
-
Enter Lab Project for Project Title.
-
Select any Type.
-
Select In Progress in the Status drop-down.
-
Select a date in the next month in the Estimated date date picker and click OK.
-
Click the Back arrow icon in the bottom-left of the screen to return to the Home screen. The number in the first tile will have incremented.
-
Select the Milestones screen (third icon).
-
Enter 50 in Milestone Percentage Complete
-
Select the Outcomes screen (fourth icon).
-
Enter To create a better planet in Goal.
-
Select Completed in the Status Reason drop-down.
-
Click Save.
-
Select the Home screen (first icon).
-
Close the app.
Task 1.2 - Review the app in Power Apps Studio
-
Select the Environmental Work Delivery app, click on the ellipses (…), and select Edit.
-
If a Welcome to Power App dialog appears, check the Don’t show me this again, and click Skip
-
In the Tree view, expand Card1.
-
Select Card1LabelValue and select Text in the Property Selector.
-
Review the formula. Note that the filter uses the My Active Projects view.
-
In the Tree view, select and expand ProjectScreen.
-
In the Tree view, select and expand ProjectGallery.
-
Select ProjectStatusDropDown and select Items in the Property Selector.
-
Review the formula. Note the use of Choices.
-
Select ProjectStatusDropDown and select OnChange in the Property Selector.
-
Review the formula. Note the use of Patch.
-
Select ProjectTitleTextInput and select OnChange in the Property Selector.
-
Review the formula. Note the use of Patch.
-
In the Tree view, select and expand MilestoneScreen.
-
Select and expand MilestoneForm.
-
Select and expand Milestone Percentage Complete
-
Select DataCardValue2 and select OnChange in the Property Selector.
-
Review the formula. Note the use of SubmitForm.
-
In the Tree view, select and expand OutcomeScreen.
-
Select and expand OutcomeForm.
-
Select Button2 and select OnSelect in the Property Selector.
-
Review the formula. Note the use of SubmitForm.
-
Select HomeScreen.
-
In the Tree view, select App.
-
Select OnStart in the Property Selector.
-
Review the formulas.
-
Select the ellipses (…) to the right of App and click Run OnStart.
-
In the ribbon at the top of the app designer, select the View tab.
-
Select Variables.
-
Review the variables for column widths and heights. The controls on screens use these variables for their X, Y, Height, and Width.
-
Review the variables for column widths and heights. The controls on screens use these variables for color properties.
-
Click the back arrow to return to the canvas.
-
In the Tree view, select TitleLabel under HomeScreen.
-
Select X in the Property Selector and note the use of a variable.
-
Select Y in the Property Selector and note the use of variables in the formula.
-
In the ribbon at the top of the app designer, select the View tab.
-
Select Collections.
-
Review the three collections.
-
Click the back arrow to return to the canvas.
-
In the menu, select File and then Close. If there are unsaved changes click Don’t save.
Exercise 2 – Change the visual experience of the canvas app
In this exercise, you will change the layout and colors used in the canvas app.
Task 2.1 - Layout
In this task, you will perform the following changes to the app:
- change the variables used for column and row layout
-
Navigate to the Power Apps Maker portal https://make.powerapps.com.
-
Make sure you are in the Practice environment.
-
Select Solutions.
-
Click to open the Fabrikam Environmental solution.
-
In the Objects pane on the left, select Apps.
-
Select the Environmental Work Delivery app, click on the ellipses (…), and select Edit.
-
In the Tree view, select App.
-
Select OnStart in the Property Selector.
-
In the OnStart, change Set(BarrierSize,20) to Set(BarrierSize,10). Note that you can click the caret to the right of the formula bar to expand it.
-
Select the ellipses (…) to the right on App and click Run OnStart. Note that the layout adjusts and the tiles become bigger.
-
In the OnStart, change Set(LeftHandWidth,App.Width/10) to Set(LeftHandWidth,App.Width/12).
-
Select the ellipses (…) to the right on App and click Run OnStart. Note that the layout adjusts.
-
In the menu, select File and then Close. If there are unsaved changes click Don’t save.
Task 2.2 - Colors
In this task, you will perform the following changes to the app:
- change the variables used for colors
- update the colors used for controls in the gallery
-
Select the Environmental Work Delivery app, click on the ellipses (…), and select Edit.
-
In the Tree view, select App.
-
Select OnStart in the Property Selector.
-
In the OnStart, change Set(FabrikamBackColor,RGBA(0,0,0,1)) to Set(FabrikamBackColor,Color.Black).
-
In the OnStart, change Set(FabrikamFrontColor,RGBA(255,255,255,1)) to Set(FabrikamFrontColor,Color.Azure).
-
Select the ellipses (…) to the right on App and click Run OnStart. Note that the colors change.
-
In the menu, select File and then Save.
-
Click the back arrow to return to the canvas app editor.
-
In the Tree view, select and expand ProjectScreen.
-
Select and expand ProjectGallery.
-
Select ProjectTitleTextInput and select BorderColor in the Property Selector.
-
Replace the RGBA value in the formula bar with FabrikamColor.
-
Select ProjectTypeComboBox and select ChevronBackGround in the Property Selector.
-
Replace the RGBA value in the formula bar with FabrikamColor.
-
Select BorderColor in the Property Selector for the ProjectTypeComboBox.
-
Replace the RGBA value in the formula bar with FabrikamColor.
-
Repeat the steps to change the BorderColor and ChevronBackGround color to FabrikamColor for ProjectStatusDropDown.
-
Repeat the steps to change the BorderColor and IconBackground color to FabrikamColor for EstimatedCompletionDate.
-
In the menu, select File and then Save.
-
Click the back arrow to return to the canvas app editor.
Task 2.3 - Background
In this task, you will perform the following changes to a screen:
- add an image as a background
-
In the Tree view, select ProjectScreen.
-
In the Properties pane on the right-hand side, select Background image > + Add an image file.
-
Locate and select the Texture.jpg file and click on Open.
This file is located in the Documents\PL-200 folder on your machine.
-
The image will be added as the background for the screen.
-
Select Fit in the Image position drop-down.
-
In the menu, select File and then Save.
-
Click the back arrow to return to the canvas app editor.
Task 2.4 - Label
In this task, you will perform the following changes to a label:
- correct the card label on the home screen
-
In the Tree view, select and expand HomeScreen.
-
Select and expand Card3.
-
Select Card3LabelValue and view the Text Property. Note that this card is displaying the count of Active Outcomes, but the label incorrectly says Active Milestones.
-
Select Card3LabelHeader and select Text in the Property Selector.
-
In the formula bar, change “Active Milestones” to “Active Outcomes”
-
In the menu, select File and then Save.
-
Click the back arrow to return to the canvas app editor.
Task 2.5 - Button
In this task, you will perform the following changes to the button:
- change the name of the button
- set the button as disabled if there are no rows
-
In the Tree view, select and expand OutcomeScreen.
-
Select the ellipses (…) next to Button2 and select Rename.
-
Enter SaveBtn.
-
With the button still selected, select DisplayMode in the Property Selector.
-
Enter the following formula:
If(CountRows(OutcomeGallery.AllItems) > 0, DisplayMode.Edit, DisplayMode.Disabled)
-
In the menu, select File and then Save.
-
Click Publish.
-
Click Publish this version.
Exercise 3 – Logic
In this exercise, you will update formulas and logic in the canvas app.
Task 3.1 - Outcome Status
In this task, you will perform the following changes to the screen:
- remove Status Reason and replace with new choice column
-
Navigate to the Power Apps Maker portal https://make.powerapps.com.
-
Make sure you are in the Practice environment.
-
Select Solutions.
-
Click to open the Fabrikam Environmental solution.
-
In the Objects pane on the left, select Apps.
-
Select the Environmental Work Delivery app, click on the ellipses (…), and select Edit.
-
In the Tree view, select and expand OutcomeScreen.
-
Select and expand OutcomeForm.
-
In the Properties pane, click Edit fields.
-
Click + Add field.
-
Select Outcome Status.
-
Click Add.
-
Select the ellipses (…) next to Status Reason and select Remove.
-
Select and expand OutcomeGallery.
-
Select Subtitle5_1 and select Text in the Property Selector.
-
In the formula bar, replace ThisItem.’Status Reason’ with ThisItem.’Outcome Status’
Task 3.2 - Outcome form
In this task, you will perform the following changes to the screen:
- correct the initialization of the form
- use the LookUp formula with a Dataverse table
-
Select and expand OutcomeGallery.
-
Select NextArrow5_1 and select OnSelect in the Property Selector.
-
In the formula bar, replace NewForm(OutcomeForm) with Select(Parent).
-
Select OutcomeForm and select Item in the Property Selector.
-
Enter the following formula:
LookUp(Outcomes, Outcome = OutcomeGallery.Selected.Outcome)
Task 3.3 - Milestone form
In this task, you will perform the following changes to the screen:
- correct the initialization of the form
-
In the Tree view, select and expand MilestoneScreen.
-
Select and expand MilestoneGallery.
-
Select NextArrow5 and select OnSelect in the Property Selector.
-
In the formula bar, replace NewForm(OutcomeForm) with Select(Parent).
Task 3.4 - Project type
In this task, you will perform the following changes to the screen:
- display the Project Type for existing records
-
In the Tree view, select and expand ProjectScreen.
-
Select and expand ProjectGallery.
-
Select ProjectTypeComboBox and select DefaultSelectedItems in the Property Selector.
-
In the formula bar, enter ThisItem.’Project Type’.
-
In the menu, select File and then Save.
-
Click Publish.
-
Click Publish this version.
-
In the menu, select File and then Close.
Exercise 4 – Power Automate
In this exercise, you will add a Power Automate flow to the canvas app to reset the status of a Milestone.
Task 4.1 - Create flow
In this task, you will perform the following changes to the screen:
- create an instant flow for use in the canvas app
- perform a flow action to reset the status of a Milestone
-
Navigate to the Power Apps Maker portal https://make.powerapps.com.
-
Make sure you are in the Practice environment.
-
Select Solutions.
-
Click to open the Fabrikam Environmental solution.
-
In the Objects pane on the left, select Cloud flows.
-
In the solution, select + New > Automation > Cloud flow > Instant.
NOTE: If a Welcome to Power Automate dialog appears, click Get Started.
-
Enter Reset milestone status for Flow name
-
Select PowerApps for Chose how to trigger this flow.
-
Click Create.
-
Click on + New step.
-
Select the Microsoft Dataverse connector.
-
Select the Update a row action.
-
Select Milestones for Table name.
-
Click in the Row ID field.
-
In Dynamic content, select Ask in PowerApps.
-
Expand Show advanced options.
-
Enter 0 for Milestone Percentage Complete..
-
Select Planned for Milestone status.
-
Click Save and wait for the flow to save.
-
Click the back arrow icon in the top-left of the flow editor.
Task 4.2 - Add flow to canvas app
In this task, you will perform the following changes to the screen:
- add the flow to the canvas app
- run the flow from a button
-
In the Objects pane on the left, select Apps.
-
Select the Environmental Work Delivery app, click on the ellipses (…), and select Edit.
-
In the left menu, select the Power Automate icon.
-
Click + Add flow.
-
Select Reset milestone status.
-
The flow will be added to the app.
-
In the Tree view, select and expand OutcomeScreen.
-
Select SaveBtn.
-
Select the ellipses (…) next to the button in the Tree View and select Copy.
-
In the Tree view, select and expand MilestoneScreen.
-
Right-click in the app area and select Paste.
-
Select the ellipses (…) next to SaveBtn_1 and select Rename.
-
Enter ResetBtn.
-
Select Text in the Property Selector and enter “Reset”.
-
Select DisplayMode in the Property Selector and change the formula to use the “MilestoneGallery”.
-
Select OnSelect in the Property Selector.
-
Enter the following formula:
Resetmilestonestatus.Run(MilestoneGallery.Selected.Milestone);Refresh(Milestones);
-
Drag ResetBtn under the form.
Task 4.3 - Publish and share the app
-
In the menu, select File and then Save.
-
Click Publish.
-
Click Publish this version.
-
In the menu, select File.
-
Click Share.
-
Enter Alex in Enter a name, email address, or Everyoneand select Alex Wilber
-
Click Share.
-
Enter Patti in Enter a name, email address, or Everyone and select Patti Fernandez.
-
Check the Co-owner box.
-
Click Share.
-
Click Cancel to close the sharing pane.
-
Close the tab.
Exercise 5 – Solutions
In this exercise, you will export the solution from the Practice environment and import it into the MOD Administrator’s environment.
Task 5.1 – Export managed solution
-
Navigate to the Power Apps Maker portal https://make.powerapps.com.
-
Make sure you are in the Practice environment.
-
Select Solutions.
-
Select the Fabrikam Environmental solution but do not open it.
-
Select Export solution.
-
Click Next.
-
The version number should have been incremented to 1.1.11.10.
-
Select Managed for Export As.
-
Click Export.
-
The export will be prepared in the background. When the solution is ready, click the Download button.
Task 5.2 – Export unmanaged solution
-
Select the Fabrikam Environmental solution.
-
Select Export solution.
-
Click Next.
-
The version number should have been incremented to 1.1.11.11
-
Select Unmanaged for Export As.
-
Click Export.
-
The export will be prepared in the background. When the solution is ready, click the Download button.
Task 5.3 – Import managed solution
-
Switch environments by using the Environment Selector in the upper right corner of the Maker portal.
-
Select the MOD Administrator’s Environment environment from the list.
-
Select Solutions.
-
Select Import solution.
-
Select Browse, change to the Downloads folder and select FabrikamEnvironmental_1_1_11_10_managed.zip and select Open.
-
Click Next.
-
Click Import. The solution will import in the background.