02-Microsoft Dataverse Lab Manual
02-Microsoft Dataverse Lab Manual
App in a Day
Module 2: Microsoft Dataverse
Hands-on Lab Step-by-Step
February 2021
Power Platform App in a Day Microsoft Dataverse
Contents
Microsoft Dataverse .............................................................................................................................................................. 2
Task 1: Add Microsoft Dataverse table as a data source to the app ............................................................................................................. 23
Task 2: Create the edit form ........................................................................................................................................................................................ 24
Task 3: Configure the title column ............................................................................................................................................................................ 29
Task 4: Configure the price Field ............................................................................................................................................................................... 31
Task 5: Configure the approval Field ....................................................................................................................................................................... 33
Task 6: Configure the Comment Field ..................................................................................................................................................................... 34
Task 7: Configure the Requested By Field .............................................................................................................................................................. 35
Task 8: Configure the requested date Field ............................................................................................................................................................ 36
Task 9: Add a button to submit the form ............................................................................................................................................................... 37
Task 10: Test the form ................................................................................................................................................................................................... 39
Task 11: Verify a new item was added to the Device Order table ................................................................................................................. 41
Task 12: [Optional] Navigate to confirmation screen after the Form submit is successful .................................................................. 42
References ............................................................................................................................................................................ 50
Copyright ............................................................................................................................................................................. 51
Microsoft Dataverse
Lab Prerequisites
This is the second lab in a series covering Power Apps Canvas Apps, Microsoft Dataverse, Power Apps Model-driven Apps,
Power Automate, and Power BI. The assumption is that you have successfully completed the initial part of setting up an
environment as described in the overview document – “00-AppInADay Lab Overview.pdf”.
If you have not completed building the Power Apps Canvas App in Module 1, you can use the partially completed version
of the lab package in the “\Completed\Module1” folder. Follow the instructions in the document “Importing Module 1
Completed” before proceeding with this module.
1. Have a Test Environment with permission to create a Microsoft Dataverse database: You should have
gone through the steps to create a new environment using the Admin center. In this lab, you will create a
database in this environment if you haven’t already created one.
2. Sign-in to Power Apps: Go to Power Apps and sign in with the same account you used to complete the first
lab. Make sure you switch to the environment where you created the app.
Overview
The Microsoft Dataverse adds data storage and modeling capabilities to Power Apps that is scalable and easy to provision.
In this module, you will be using Microsoft Dataverse to model and store the data from the device ordering canvas app
that you built in module 1. In the next module, you will be building a model-driven application using the same data that
will be used by the back-office staff to process the device orders. These apps that you build on Microsoft Dataverse use
the same technology framework (Microsoft Dataverse) that Microsoft Dynamics 365 apps are built-on.
Microsoft Dataverse abstracts a lot of the typical low-level database management work to make it easier for you to
configure a custom data model that fits your application.
In addition to allowing for the creation of custom Tables, Microsoft Dataverse contains a Common Data Model (CDM)
consisting of hundreds of standard table definitions. You can find the current CDM schema at Github Microsoft CDM and
you can browse the CDM using the CDM Visual Table Navigator located here Github CDM. You can read more about the
CDM here Common Data Model Overview .
Before beginning the exercises, navigate to Make Power Apps and confirm that you are in the desired environment for the
labs.
2. This will bring up the list of Tables in this database instance. Click on a few of the standard Tables (for example,
Account) to get familiar with some of the features of an table.
Columns:
An table has a list of columns. In the example below, the “Account” table has columns such as Account Name, Account
Number, etc. Each column has a data type, such as Text, Number, etc. The data type is chosen when you create a column
and is not changeable. The data type also defines many of the characteristics and behaviors of the column when your
application runs. For example, a Choice allows you to have a pre-defined list of values for use in your application. When
this column is used on a form in a model-driven application the visual presentation is a drop-down control. The column
helps to ensure data consistency and allows for built-in support for multi-language applications.
To see all the columns for the table, change the default view in the top right corner to show all, or once you reach the
bottom of the list you can click Remove Filter.
For a list of supported data types, see Microsoft Dataverse Supported Data Types
Relationships:
Relationships allows you to manage relationships between Tables. Relationships supported are One to Many (1:N), Many
to One (N:1) and Many to Many (N:N). Relationships also define the behavior that happens when actions occur on the
primary Row in a 1:N relationship. For example, if the parent Row is deleted you can configure the relationship behavior
so that all child Rows are also deleted or simply remove the reference.
Note: You will need to click the Relationships tab to see relationships. If you don’t see any relationships, click the Reset the
Filter button.
Business rules:
Building a Business rule is like building a flowchart where you can define conditions and actions. You can learn more about
Business rules in the link below.
Views:
Views will let you define how a list of Rows are shown in the app. You can create multiple custom views, each having their
own filtering and sorting criteria. For example, you could create a view to see only the Rows created in the last week and
another one to see Rows that haven’t been updated in a year. Create views to make the application users more
productive in filtering their data.
Forms:
Forms provide the user interface that people use to interact with the data they need to do their work. It's important that
the forms people use are designed to allow them to find or enter the information they need efficiently. You can create
different types of forms like Quick Create, Quick View, Card, and a Main form. For some of these forms you can have more
than one version, to accommodate for different user roles within your organization.
Dashboards:
Dashboards helps you bring your views, charts, and web resources together in one place.
Charts:
Use Charts to display high-level view of your data in insightful and graphical ways.
Keys:
Allows you to view the lookup keys for the table. Keys can contain multiple columns to define a composite key. Keys
enforce uniqueness, so they should not be used when there is a need to store duplicate values of columns used.
Data:
You can view and search the data in the table. This gives you a quick way to see some of the data for the table without
having to jump into a specific Canvas or Model-driven app.
1. Select Tables in the left pane and click New Table in the upper left corner of the page.
2. Enter Device Order for Display Name. The columns for Name and Plural name display name will automatically
populate based on your entry. These are editable in case you need to make any changes. The plural name is used
by the system by default anytime a set of the Rows are shown. Check the Enable attachments since this will allow
creating notes on the device order.
3. Change the Primary Column Display Name to Device Name. The primary attribute defaults to being named
Name, for some scenarios that might not be the best label and you can customize it if needed. The primary
attribute however is always a Text column, that is not changeable.
4. Click Create.
1. Select the Columns tab and click on the Add column button to add columns to your custom table.
2. Enter Price for Display Name, select Currency for Data Type, make the column Required and Searchable and
click Advanced Options.
Note: Currency is a special data type. For each currency column you add, another currency column is added with
the prefix “_Base” on the name. This column stores the calculation of the value of the currency column you added
and the base currency. For additional information on using the Currency column, see here.
3. Enter Device Price for Description, 0 for Minimum Value, 5000 for Maximum Value, and click Done.
6. Now repeat the Add Column process and add the following columns
7. Now we are going to create the Approval Choice. We are adding this as a Choice (as opposed to a two option)
because it is likely in the future there will be more than Yes/No for users to choose from. Click Add Column.
8. Enter Approval Status for Display Name, ApprovalStatus for Name, select Choice for Data Type, and select
New Choice for Choice.
1. In the upper left corner of the screen, click on Add Column to add columns to your custom table.
2. Enter Department Contribution for Display Name, Currency for Data Type, click Add Calculated or Rollup,
and select Calculation.
3. Click Save.
4. If you have not yet allowed popups from Power Apps, you will be prompted to do so now.
9. Click Done.
Note on currency columns: You might notice that there are two Department Contribution columns one with
(base) next to it. Currency columns in Microsoft Dataverse store the base currency value (this is the configured
default currency for the environment) and the transaction currency (this can be selected on a Row by Row basis)
to allow support for multi-currency transactions. Generally, you will want to make sure to pick the column without
the (base) in the name. The (base) value is commonly used in reporting where you want to normalize multiple
currencies to allow reporting on them in the base currency value.
1. Select the Business rules tab and click Add business rule.
3. Change the Name to Calculate Ship Date and click the arrow to Hide Details.
5. In the Rule 1 section select Entity for Source, Approved Date for Column, Contains Data for Operator and click
Apply.
Note: You may need to scroll down to the bottom of all scroll bars to see the Apply button. You must click Apply after any
change to the properties otherwise they will revert to the prior value. The Business Rule (Text View) will automatically update
after you hit apply when you are done modifying the rule.
8. Enter Set Estimated Ship Date for Display Name, select Estimated Ship Date for Column, Formula for Type,
Approved Date for Column, + for Operator, Value for Type, 14 for Days, and click Apply.
9. Click Validate.
13. Confirm activation. Business rules only execute when they are activated. In the future to make changes to rules
you deactivate them, make the change, and then re-activate the rule.
16. Your Device Order table will have one Business Rule.
1. Select Apps, select the Device Order App you created in Module 1, and click Edit.
2. Select the Data sources to display the current sources. Expand Entities.
3. Click on Device Orders from the table list to include it as a data source for our app.
2. Select few devices. Hold the “Alt” key, and then it will allow you to check the compare on the devices.
3. Select the Compare Screen. You should now have the selected devices.
5. Click the Data Source drop-down in the Data pane on the right.
8. Add, remove, and order fields like the list below. The fields are added using the plus sign and can be reordered by
dragging the field to the desired placement.
a. Device Name
b. Price
c. Approver
d. Comments
e. Requested By
f. Request Date
Note: You can always select controls, such as the Form1 control, from the tree view on the left to make sure you are
selecting the correct control. To move it make sure you select the Form and not a control within the form.
11. Change the Snap to columns setting from 3 to 1. This will modify the layout of the edit form to be single
column.
For more info on working with multi-column form layouts, see Working with forms layout.
12. To create a new instance of the form when the screen is loaded. Click Compare Screen in left tree view pane.
Let’s start by configuring the Title to display the manufacturer and device name for the selected device. For example, if the
user selects the Surface Pro device, we want the device order to have the title: “Microsoft – Surface Pro”.
StarVisible1: This is a label control that has an asterisk (*) which has its Visible property set to true or false depending
on whether the Field is Required or not. Since the Title Field was marked as Required when you configured the table,
its Required property is set to true.
ErrorMessage1: This is a label that is just below the main data entry Field which displays error messages.
DataCardValue1: This is the text input control where you can enter the Title. For this scenario, we will set the title
based on the selected device.
DataCardKey1: This is the label that displays the title of the Field.
2. Select Device Name DataCardValue in the tree view. Then, open the Advanced tab in the right-hand pane.
For the next few steps, we will use the Advanced pane to customize control properties within the form, note that you can
perform the same customizations using the property drop-down and formula bar in the top left of the studio.
5. Click More Options button in the DESIGN section of the Advanced pane. We are going to change the Device
Name Field to be read only so they don’t change it.
6. Change the DisplayMode to DisplayMode.View. This will prevent users from changing the value within the text
box.
1. Expand Price.
4. Change the Default property in the Data section to: 'Compare List Gallery'.Selected.Price
5. Select the Price Field and change the DisplayMode property to DisplayMode.View.
You will use the Office 365 graph to retrieve the manager’s email. You can find more about the Office 365 Users
Connection provider here Office 365 Users Connection Provider
5. Set the Default value to: User().Email This expression will use your user’s email, so you won’t accidentally e-
mail your manager to approve your testing.
In a real application or if you wanted to try the expression to use your managers email would be
Office365Users.Manager(User().Email).Mail This would make an API call at runtime to get the manager’s
email address of the logged-on user. If you try this and hit an error when calling the Office365Users.Manager()
function, this may be because a manager is not set up in the system for the logged in Office 365 user. In that case,
you can simply go back go User().Email.
6. Save your work and return to the continue editing the app.
The Office 365 User connector has access to many other valuable types of information you can learn more about
the other actions and data available here Office 365 users Connector
2. Select the Properties tab and change the Size -> Height value to 80.
Optionally, you may select the Text Input control DataCardValue and set its HintText property to: “Enter justification”
(without quotes).
Notice that the date in the calendar control will change to today’s date.
Now we will hide the Request Date card. We don’t need to show this Field to the user. Since we have included it as part of
the form the Field will get updated as part of the form submit.
5. Select the Request Date DataCard
4. Position it in the bottom right of the screen, center aligned with the Form.
5. Make the button larger – you can resize to 280x60 using the Properties pane on the right.
8. The button should be enabled only if a device is selected. To do this, change the button’s DisplayMode property
to: If(!IsBlank('Compare List Gallery'.Selected), DisplayMode.Edit, DisplayMode.Disabled)
Note: You might notice the exclamation mark (!) in the formula !IsBlank() Normally if you just have IsBlank() the
check is for blank. Adding the exclamation mark (!) in front of it changes it to check if it is NOT blank.
9. Next, we are going to configure what we want to happen when the button is clicked. Set the OnSelect property
to SubmitForm(Form1) .
When the button is pressed, the form data will be submitted to the Microsoft Dataverse.
10. Save your work and return to continue editing the app.
Notice that the Title, Price, Approver, and Requested By Fields are already filled in.
4. Change the Approver email to your own email for test purposes.
5. Add some Comments, such as: “Current laptop does not work, need a new device.”
6. Click Submit device request.
The button should turn disabled (gray) for a few seconds while it’s submitting the request. If it does not do this
there is likely an error. Click the X in top right to get back to the design mode.
If there is an error, you will see a yellow error icon next to the Submit button, hover over it to check the error.
7. The form will become empty after the Row gets created, we will fix this issue in optional task. Exit the preview
mode (‘X’ in top right).
Task 11: Verify a new item was added to the Device Order table
1. Open a browser window, go to Make Power Apps.
2. Click on Data -> Tables.
Once the Form has been successfully submitted, it’s a good idea to show a confirmation screen and allow the user to
navigate back to the main screen.
8. Go to the to the Submit Success Screen, paste the header and align Top.
9. Insert another label in the middle of the screen and set the Text to: "Your device request has been successfully
submitted. Thank you."
10. Increase the font size, the size of the label and center the text.
12. When the button is pressed, let us remove all the items from the CompareList collection and navigate to the first
screen.
Clear(CompareList);Navigate('Main Screen',ScreenTransition.None)
Note: ‘;’ is used a separator when multiple functions are called one after the other. If you are in a locale where ‘;’ is used as
a comma-separator, then use a double ‘;’ here (without the single-quotes).
14. Move the label up and add a Display Form: Insert -> Form -> Display.
15. Configure its data source to point to the ‘Device Order’ table.
16. Select the Fields to display: Device Name, Price, Comments, Approver, Requested By, Request Date. Rearrange and
remove any additional Fields.
20. Reposition/Resize the form until it looks like the image below. The Label will be first on the screen, centered under
the header. Then, position the view form to be centered under the label. Finally, the “OK” button will be should be
centered at the bottom of the page under the view form.
24. Select one of the new devices, provide a comment and click Submit.
25. Verify that the confirmation screen shows the order details. Click OK.
26. The application will navigate back to the main screen and the compare list will be cleared.
Lab survey
We would appreciate your feedback on the Power Platform technologies and on this hands-on-lab, such as the quality of
documentation and the usefulness of the learning experience.
Please use the survey at App in a day lab survey to share your feedback.
You may provide feedback for each module as you complete it or at the end once you’ve completed all the modules.
Thank you!
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 and Power BI.
Copyright
© 2021 Microsoft Corporation. All rights reserved.
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.