0% found this document useful (0 votes)
6 views34 pages

Module 3 - Power Apps Model-Driven App

The document outlines a hands-on lab for creating a Power Apps Model-driven application, focusing on building an app to manage machine orders within an organization. It includes prerequisites, step-by-step exercises for creating the application, adding columns to a table, and implementing a Business Process Flow to guide users through procurement tasks. The lab emphasizes the use of Microsoft Dataverse and various design tools to facilitate the development of data-driven applications.

Uploaded by

A
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views34 pages

Module 3 - Power Apps Model-Driven App

The document outlines a hands-on lab for creating a Power Apps Model-driven application, focusing on building an app to manage machine orders within an organization. It includes prerequisites, step-by-step exercises for creating the application, adding columns to a table, and implementing a Business Process Flow to guide users through procurement tasks. The lab emphasizes the use of Microsoft Dataverse and various design tools to facilitate the development of data-driven applications.

Uploaded by

A
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Power Platform

App in a Day
Module 3: Power Apps Model-driven App
Hands-on Lab Step-by-Step

July 2023
Contents
Power Apps Model-driven App ............................................................................................................................................ 1

Lab Prerequisites ............................................................................................................................................................................................................... 1

Exercise 1: Create Application and add Columns to the Machine Order Table .......................................................................................... 2

Exercise 2: Business Process Flow ................................................................................................................................................................................ 9

Exercise 3: Form and View Modification ................................................................................................................................................................. 22

Exercise 4: Test the application .................................................................................................................................................................................. 27

References .......................................................................................................................................................................................................................... 31

Copyright ............................................................................................................................................................................. 32
Power Platform App in a Day Module 3: Power Apps Model-driven app

Power Apps Model-driven


App
Lab Prerequisites
This is the third lab in a series covering Power Apps canvas apps, Microsoft Dataverse, Power Apps model-driven apps,
and Power Automate. The assumption is that you have successfully completed the first two modules, or at least the initial
part of setting up an environment as described in the overview – “00-AppInADay Lab [Link]”.

If you have not completed the previous two modules, you can use the partially completed version of the lab package in
the “\Completed\Module2” folder. Follow the instructions in the document “Importing Module 2 Completed” before
proceeding with this module, which will provision the app, and the Microsoft Dataverse table into your environment.

Model-driven Apps – A brief introduction


Model-driven app design is an approach that focuses on adding components such as forms, views, and charts and
dashboards to tables using an app designer tool. Additionally, relationships connect tables together in a way that
permits navigation between them and ensures that data is not repeated unnecessarily.

Using the app designer with little or no code, you can build apps that are simple or very complex.

Model-driven apps are especially well suited to process driven apps that are data dense and make it easy for users to
move between related records. For example, if you are building an app to manage a complex process, such as
onboarding new employees, managing a sales process, or member relationships in an organization such as a bank, a
model-driven app is a great choice.

While they're called model-driven apps, it is often easier to think of them as data model driven apps. This is because,
without a data model housed within Microsoft Dataverse, you can't create a model-driven app.

• App Designer specifies the sitemap, global dashboards, business processes flows, and tables forms, views, and
dashboards learn more
• Sitemap Designer provides the application navigation that is always available learn more
• Business Process Designer provides stages and steps to guide users consistently through common business
processes within a form learn more
• Table Designer defines the Columns, relationships, and metadata for a table learn more
• Business Rule Designer provides no-low business logic for a table learn more
• View Designer specifies Columns and filter conditions for a Row list learn more
• Form Designer specifies the Columns and controls along with layout for a single Row learn more
• Dashboard Designer summaries one or more tables using charts, lists, etc. learn more

1|Page ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

Scenario for building a Model-driven app


In the first lab module, you built a Power Apps Canvas application for an organization where every few years the
employees go through a coffee machine replacement cycle. The application let employees place a request for a machine
using the Power Apps app that you built. In the second lab module, using a custom table you created in the Microsoft
Dataverse lab, you stored that request for processing.

From the requesting employee's point of view, after they place the order, the new coffee machine just magically shows up.
But there is a back-office process that needs to happen to manage the procurement, setup of the device, and distribution
of the machine to that requesting employee. In this lab you will be building a Power Apps Model-driven app that will be
used by the two or three back-office staff that manage fulfilling machine requests. Using the Model-driven app style, you
can take advantage of the Business Process feature of Model-driven apps to keep the back-office staff on track for each
machine request.

Model-driven apps are a type of application you can build directly from [Link]. Model-driven apps make it easy
to build forms over data applications quickly. This style of application brings together forms, views, dashboards, and charts
quickly to provide a productive user experience for working with related data. These components can quickly be
customized to show only the data that is relevant for the scenario.

Table views: Views are what users see when they look at a list of Rows from the Microsoft Dataverse. Views define the
columns that are visible as well as the criteria for inclusion of the Rows in the display.

Table forms: Forms are used when users drill down into a Row from a table View. Forms are created using a visual drag-
and-drop designer to place Columns into the form that is structured into tabs and sections.

Business process flows: These flows are interactive visual guides to help the user through a business process. Business
process flows use the concept of stages that contain steps. Stages are milestones in the process that need to be
completed and the steps highlight to the user either data to collect or tasks to complete the stage to progress. Flows are
created using a visual designer using drag and drop to compose the flow and establish any branching conditions
(different paths in the business process) that must be handled.

For more details on Model-driven apps and the differences between Canvas apps and Model-driven apps, see the product
announcement at Announcement.

Exercise 1: Create Application and add Columns to the Machine


Order Table
In this exercise, you will be creating a standalone Model-driven application that will leverage the same Machine Order
table you created in the Microsoft Dataverse in Lab 2.
©2023 Microsoft Corporation 2|Page
Power Platform App in a Day Module 3: Power Apps Model-driven app

Task 1: Create an application


The first thing you will do is create a Model-driven application. This application will serve as a container to identify all the
components that make up the application. It will also include a sitemap that defines the custom navigation users will use
to navigate between the components (table views, dashboards, and other visual components).

1. Navigate to Make Power Apps, and select the environment you created.
2. Select Solutions and click to open the Contoso Coffee solution.
3. Click + New and select App | Model-driven app.

4. Enter Machine Procurement for Name and click Create.

Next, you will build a Site Map for the application, the completed Site Map will look like the image below .

3|Page ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

5. Select the Navigation tab and then select Group1.

6. Go to the Display options pane, enter Orders for Title, and nav_ordersgroup for ID.
Note: The properties panel on the right will only show if you click on the New Group on the left.

7. Select the Subarea1.

©2023 Microsoft Corporation 4|Page


Power Platform App in a Day Module 3: Power Apps Model-driven app

Note: The properties panel on the right will only show if you click on the Subarea1 on the left.

8. Set the Table for Content type, select Machine Order for Table, enter Machine Orders for Title, and enter
nav_machine_orders for ID.

9. The application should now look like the image below. Click Save.

5|Page ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

10. Publish the application.


11. Click on the  Back button.

Task 2: Add procurement columns to the Machine Orders


In this task, you will add new columns to the Machine Order table. The columns you are going to add here are columns
that support the Business Process Flow, which we are going to build in the next exercise. When you use a Business
Process, it consists of Stages which you can think of as major milestones in completing the work. Each Stage has one or
more Steps. Steps help users keep track of what they need to do before advancing to the next Stage. Steps are just
columns on the table. To make it quicker when we create the Business Process in this task, we are going to first create the
columns that we need.

To support our scenario, we are going to add the following columns to the table:

Capital Approved: This column will be used in the flow to capture that the machine order has received capital approval.

Send Survey: This column will be used in the final stage. Right now, the team plans on manually sending a survey to see
how the user’s ordering experience was, and will manually check this once they send it, but they have a desire in a future
update to automate sending a survey in a future release.

1. Navigate to Make Power Apps


2. Select Solutions and click to open the Contoso Coffee solution.
3. Select Tables and click to open the Machine Order table.

©2023 Microsoft Corporation 6|Page


Power Platform App in a Day Module 3: Power Apps Model-driven app

4. Click + New and select Column.

5. Enter Capital Approved for Display Name, select Yes/No for Data Type and click Save. We are using a Yes/No
data type here because when we use it as a Step in the Business Process, we want to be able to simply mark it
completed. Yes/No are a true or false Column.

7|Page ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

6. Create 4 more Yes/No Columns and name them Machine Received, Machine Configured, Send Survey,
and Machine Delivered.

7. Add another Column, with the name Supplier Order ID, select Single line of text for Data Type, select
Text for Format, and click Save. Notice we are not asking you to make this Column required here, but
we will make it a required Column in the Business Process later in the lab.

©2023 Microsoft Corporation 8|Page


Power Platform App in a Day Module 3: Power Apps Model-driven app

Exercise 2: Business Process Flow


In this exercise, we are going to add a Business Process Flow to the Machine Order to help guide the back-office worker
through the task of managing the procurement of the requested device.

In discovery meetings with the back-office workers, we learned that a machine request goes through the following tasks as
they perform the magic to get the requestor their machine.

- Machine Requested – Today this is an e-mail sent to them with the machine request. Going forward in the new
Power Apps world this will be a machine Order Row in the Microsoft Dataverse.
- Place Order – Once they receive the request, they will place an order with a supplier and get an order ID.
- Receive Machine – This occurs when the machine is received, and they send it to the technician to be configured
with the standard configuration.
- Distribute Machine – Once configured it needs to get to the employee that requested it, and they need to survey
the employee to make sure they are happy.

Each of these represents a milestone and will become our Stages in the Business Process Flow. In a more complex
scenario, you would likely end up compressing or even possibly re-imagining the business process to make it more
optimal than the current process the staff performs with their existing process.

9|Page ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

For this lab, the Receive Machine and Distribute Machine stages are marked optional. While these stages would need to be
created for a full implementation of the scenario, to save time you may skip them or do them as a take home exercise.

The completed Business Process Flow will look like the image below.

Task 1: Create business process flow


1. Select Solutions and click to open the Contoso Coffee solution.

2. Click + New and select Automation | Process | Business process flow.

3. Enter Machine Procurement Process for Display Name, select Machine Order for table, and click Create. When
you create the Business Process Flow behind the scenes it creates another table with the same name as the
Business Process Flow to track the progress of each business process on the row. Because of this, choose your
name carefully, for example, you wouldn’t want to use the same name as your table e.g. Machine Order. Here we
choose Machine Procurement Process. Note: After you click OK, a new window will be loaded with the designer.
If you have popup blockers enabled, this might be blocked. The window might also not immediately have focus
and you might have to manually bring it into focus.

©2023 Microsoft Corporation 10 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

4. Select the New Stage and change the Display Name to Machine Requested and click Apply.

5. Click Details.

6. Select the Data Step, select Request Date for Data Field and click Apply. The Step Name will auto-filled for you.

11 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

7. Click Add and select Add Data Step.

8. Click on the small + under Data Step #1.

9. Select Approval Status for Data Field and click Apply.


10. Add another Data Step, select Price for Data Field and click Apply.

©2023 Microsoft Corporation 12 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

11. Select the Components tab.

12. Drag Stage to the canvas and place to the right of the Machine Requested stage.

13. Select the new stage, change the Display Name to Place Order and click Apply.

13 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

14. Click Details.


15. Select the existing Data Step, select Estimated Ship Date for Data Field, and click Apply.

16. Select the Components tab, drag Data Step to the canvas and place is under the Estimated Ship Date step.

©2023 Microsoft Corporation 14 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

17. Select Supplier Order ID for Data Column, check the Required field and click Apply. Remember from before this
Column isn’t required, but by checking this here, we will require it to be filled out before they can advance to the
next stage. It won’t, however, block saving the row if there isn’t a data value populated like it would if it was
marked required on the Column definition.

NOTE: All steps from here onwards until you reach Task 2 are OPTIONAL. These steps add two more stages to the
business process using the same technique you learned above. You may skip ahead to Task 2 to add a branch
condition.

18. Select the Components tab and drag Stage to the right side of the Place Order stage.

19. Select the new stage, change the Display name to Receive Machine and click Apply.

15 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

20. Click Details.


21. Select the existing Data Step and select Machine Received for Data Column and click Apply.
22. Select the Components tab, drag Data Step to the Receive Machine stage and place it under the Machine
Received step.
23. Select Machine Configured for Data Column and click Apply.

24. Add another stage and name it Distribute Machine.


25. Add two data steps Machine Delivered and Send Survey.

©2023 Microsoft Corporation 16 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

17 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

Task 2: Add a branch condition


In this task, we are going to add a conditional branch to our Business Process Flow. When we did the discovery, we
learned that if the price was greater than $10K there were additional steps in place to get capital approval prior to placing
the order. In this task, you will see how we can modify the flow we built to accommodate this.

1. Select the Components tab, drag Condition and place it between Machine Requested and Place Order.

2. Select the Condition and change the Display Name to Check Price.

3. In the Rule 1 section, select Price for Column, is greater than for Operator, Value for Type, 10000 for Value, and
click Apply. It’s important to note that Columns you use in the rules on the condition must be in the prior Stages
steps. That is one of the reasons we put the price in there previously.

©2023 Microsoft Corporation 18 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

4. Click Save.

5. A new stage will be added.

6. Select the new stage, change the Display Name to Capital Approval and click Apply.
7. Click Details.

19 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

8. Select the existing Data Step, select Capital Approved for Data Column and click Apply.

9. Click Save.

10. Click Activate.

11. Confirm the activation.

©2023 Microsoft Corporation 20 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

12. Close the process editor.

21 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

Exercise 3: Form and View Modification


In this exercise, we are going to modify the Machine Order form to add additional columns. When you create a table in
Microsoft Dataverse, it also creates a main Form for that table with a few basic columns on it. In addition to the form,
views are created for the table. Views are used in a Model-Driven app any time a list of the table rows are displayed. You
would modify the view to add additional Columns or change the placement. You can also create additional views, for
example, you might provide a view to show all machine requests that are waiting to be received.

Task 1: Modify the form


1. Select Solutions and click to open the Contoso Coffee solution.
2. Select Tables and click to open the Machine Order table.

3. Go to the Data experience section and select Forms.

4. Select the Information Main form and click Edit > Edit in new tab.

©2023 Microsoft Corporation 22 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

Note: The form designer is being modernized, you can read more here Overview of the model-driven form
designer.

5. If you are required to sign in again, do so.


6. Search for Approver column and drag it to the form.
7. Place the Approver Column above the Machine Name column.

8. The new form designer will let you reposition Columns. Drag the Approver column and place it between the
Machine Name and Owner columns.

9. The new form designer will let you cut and paste columns. Select the Approver column and click on the Cut
button.

23 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

10. Select the Owner column and click Paste.

11. The Approval column will be moved to the bottom.

12. Click Save and publish and wait for the publishing to complete.

13. Close the Form Designer tab.


14. Click Done.
©2023 Microsoft Corporation 24 | P a g e
Power Platform App in a Day Module 3: Power Apps Model-driven app

Task 2: Modify the view


1. Select Solutions and click to open the Contoso Coffee solution.
2. Select Tables and click to open the Machine Order table.
3. Go to the Data experience section and select Views.

1. Click to open the Active Machine Orders.

2. Click the Approval Status column once (you do not need to double click).

3. The new column will be added to the view.

25 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

4. Click on the + View Column button.

5. Select Estimated Ship Date.

6. Add Price and Status to the View.

7. Click Save and publish.


8. Click on the back button.

©2023 Microsoft Corporation 26 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

Exercise 4: Test the application


In this exercise, we are going to test the application you just built.

Task 1: Test the application


1. Select Apps, select the Machine Procurement application and click Play.

2. The application should start. The Active Machine Orders view should load.

3. Start a new web browser instance and navigate to Make Power Apps. Do not close the Model-driven application.

4. Select Apps, select the Machine Ordering application you created in module 2, and click Play.

5. Select two machines, make sure one of the machines is priced over $10,000 and click Compare.

27 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

6. Select the machine with the price over $10k and click Submit.

7. Click OK. Note that if you did not choose to create the submission success screen in a previous module that this
option will not exist. You will need complete steps 3 and 4 (above) in order to continue.

©2023 Microsoft Corporation 28 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

8. Select two more machine and click Compare.

9. Select a machine with a price under $10k, provide approver email (or leave in the auto-populated manager email)
and click Submit.

29 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

10. Go back to the Model-driven application you created and refresh the view. Sort the orders by Created On column,
and you should see the two machines you ordered using the Power Apps Canvas App.

11. Open the one priced over $10k.


12. The Business Process Flow should now have 5 stages. This is because this order costs more than $10k and needs
Capital Approval.

13. Select Machine Orders.


14. Click on the other order you created.
15. The Business Process Flow for this order should have 4 stages; this is because this order does not require Capital
Approval.

©2023 Microsoft Corporation 30 | P a g e


Power Platform App in a Day Module 3: Power Apps Model-driven app

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.

31 | P a g e ©2023 Microsoft Corporation


Power Platform App in a Day Module 3: Power Apps Model-driven app

Copyright
© 2023 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.

©2023 Microsoft Corporation 32 | P a g e

You might also like