Microsoft Dataverse is a robust application platform that stores and manages all your business data in a tight security layer. The Dataverse is made up of tables and columns of business data. The Dataverse provides a standard set of Lead, Account, Contact, Opportunity, and Quote tables, which are used in common scenarios such as lead qualification and quote review. You can also configure custom tables to fit your specific business needs. You can use dataflow to import data into your table, by using Power Query with data transformation.
Microsoft Power Platform is made up of Power Apps, Power Automate, Power BI, and Power Virtual Agent, They can be configured to use the data stored in the Dataverse.
In this chapter, you learn about working with Dataverse tables, columns, and solutions. You learn about schema customization and how to configure forms, views, and relationships between tables.
Dynamics 365 and the Dataverse are closely related. Dynamics 365 applications such as sales, marketing, and services also use the Dataverse to store data. This enables you to build apps by using Power Apps and the Dataverse directly against your core business data, which is already used in Dynamics 365, without the need for integration.
Understanding Power Apps Solutions
Solutions are a great way to package configuration items and customization components to distribute to upstream environments. This ensures Application Lifecycle Management (ALM) for solution components in Power Apps. For example, if you want to develop a custom application and have the same application in other environments or if you want to share your app with source configurations, you can package all the components into a Power Apps solution. Then you can export them from the source environment and import them into the target environment.
Versions in Solution
Create a New Solution
To create a new solution, you have to navigate to make.powerapps.com and provide the credentials. You will be directed to the Power Apps home page. Choose the environment you want to use to create the solution.
In the New Publisher panel, provide the Publisher Display Name, the Name without a space, a Description, and a prefix that’s a maximum of eight characters. Click Save.
You have successfully created a solution in Power Apps. Solutions that are freshly created are unmanaged by default. You can add components to the solution now.
The Solution Types
Solution Type | Details |
---|---|
Default | This is a special solution that contains all components in the system of the current environment. The default solution is useful for finding all the components and configurations in your system. Default solutions cannot be exported. |
Unmanaged | Solutions that are in the development stage. With unmanaged solutions, you can add, remove, and delete components. |
Managed | When an unmanaged solution is completed with the development activities and is ready for production or distribution, you can export the unmanaged solution as a managed solution by specifying the managed properties. You cannot edit components inside managed solutions unless the managed property is enabled. It is recommended that export solutions are always managed. |
Managed Properties
Publish the Solution
Every time you update a solution component, you need to publish the solution so that the changes will be reflected; otherwise, the changes will be just saved, not published.
Solution Patches
A solution patch contains changes or updates to the parent solution, such as adding or editing components. You are not required to add parent solution components to the patch unless you want to edit the component. Solution patches are useful for hotfixes and small changes to existing components of a parent solution.
Solution patches let you choose a new build or release version. You cannot change the Major or Minor version of the parent solution. Figure 2-9 shows some solution patches.
When you clone a patch, the parent solution becomes read-only. You cannot change any components inside the parent directly; rather, you have to work on the patches. Once you are ready for a major upgrade, you can create a clone of the parent solution, which will roll up all patches and create a new major version of the previous parent solution with all the components.
Cloning Solutions
When you clone an unmanaged solution, the original solution and all the patches of the solution are rolled up into a newly created version of the original solution. After you clone, the new solution version contains the original entities plus any components or tables that were added in the patch.
Export and Import Solutions
Solutions can be exported from a source environment as a managed or unmanaged solution and imported into a target environment. When you import a managed solution into a target environment where an older version of the same solution is imported, you have more options to choose when importing the managed solution.
As a best practice, you should export solutions as managed solutions so that when you import them, they can be rolled back. Unmanaged solutions cannot be rolled back.
Managed solutions are imported and stacked in multiple layers in the target environment. If you uninstall a managed solution, the changes will affect the solution below the uninstalled layer. Read more about solution layers at https://docs.microsoft.com/en-us/power-apps/maker/data-platform/solution-layers.
You can choose the Upgrade, Stage for Upgrade, and Update options when importing managed solutions.
Upgrade
Upgrade is the default option. It upgrades your solution to the latest version and rolls up all the previous patches in a single step. Any solution components associated with the previous solution version that are not in the newer solution version will be deleted in the target environment. This is the recommended option, as it will ensure that your resulting configuration state is consistent with the importing solution, including removing components that are no longer part of the solution.
Stage for Upgrade
This option upgrades your solution to the higher solution version, but does not delete the previous version and any related patches until you apply a solution upgrade. This option should only be selected if you want to have the old and new solutions installed in the system concurrently, perhaps so that you can do some data migration before you complete the solution upgrade. Applying the upgrade will delete the old solution and any components that are not included in the new solution.
Update
Maintain customizations (recommended): Selecting this option will maintain any unmanaged customizations performed on components but also implies that some of the updates included in this solution will not take effect.
Overwrite customizations: Selecting this option overwrites any unmanaged customizations previously performed on components included in this solution. All updates included in this solution will take effect. Figure 2-11 shows the options while importing an existing managed solution.
Working with Table Configurations and Settings
In the previous section, you learned how to create solutions in Power Apps. In this section, you see how to configure tables in the Dataverse. In the Dataverse, tables are used to store data. For example, you can create a table to store student data.
Table Types
Tables are classified into three categories—Standard, Activity, and Virtual. Standard tables are best when you want to store transactional or master data. For example, Student, Professor, Time Sheet, Loans and so on, can be considered standard tables. Activity tables represent activities. For example, Letter, Email, Appointment, Booking, and so on. They require a timestamp to complete the activity. All activity type tables have date and time related columns, such as Due Date, Start Time, End Time, and so on.
Virtual tables are special tables that you can create for integration purposes. They are also known as virtual entities and they enable the integration of data residing in external systems by seamlessly representing that data as tables in the Microsoft Dataverse, without replicating the data and often without custom coding. Virtual tables replace previous client-side and server-side approaches to integrating external data. These old approaches required customized code and suffered from numerous limitations, including imperfect integration, data duplication, and extensive commitment of development resources. In addition, for administrators and system customizers, the use of virtual tables greatly simplifies administration and configuration. Read more about virtual tables from Microsoft at https://docs.microsoft.com/en-us/power-apps/developer/data-platform/virtual-entities/get-started-ve.
Record Ownership
While creating tables, you need to determine whether the table will store organization owned data or user/team owned data. If you think that the records require a proper user/team level security, choose user/team owned; otherwise, choose organization owned. For example, tables such as Article, Article Template, Competitor, Currency, and Web Resource are organization owned. Tables like Account and Contacts are user/team owned because these records are owned by a user or team. They’re connected to a business unit and have specific security roles for the business unit. Therefore, these entities participate in role-based security.
Table Configurations
Tables are used to model and manage business data. When you develop an app, you can use standard tables, custom tables, or both. The Dataverse provides standard tables by default. These are designed, in accordance with best practices, to capture the most common concepts and scenarios in an organization. While configuring tables you can enable/disable many features, such as apply duplicate detection rules and enable them to create activity.
A table defines information that you want to track in the form of records, which typically include properties such as company name, location, products, email, and phone.
Types of Tables
Standard: Several standard tables, also known as out-of-box tables, are included with the Dataverse environment. Account, business unit, contact, task, and user tables are examples of standard tables in the Dataverse. Most of the standard tables included with the Dataverse can be customized. Tables that are imported as part of a managed solution and set as customizable also appear as standard tables. Any user with appropriate privileges can customize these tables, where the table property has customizable set to true.
Managed: Tables that aren’t customizable and have been imported into the environment as part of a managed solution.
Custom: Unmanaged tables that are either imported from an unmanaged solution or are new tables created directly in the Dataverse environment. Any user with appropriate privileges can fully customize these tables.
Create a New Table
The new table creation side panel will open, where you can provide table information. This chapter builds a school management system, so you see how to design the tables based on these requirements.
Requirements
This school management system must allow users to enter student information such as roll number (auto-number), name, address, father’s name, mobile, email, and qualification. The system should capture course information and the users should be able to record students joined for courses. The app must create payment information with term facility and payment details.
Add a new table with Display Name set to Student (the plural name is automatically populated as Students). Provide a description for the table, such as “Stores student information”. If you want to enable features, click the Advanced options. Choose Type as Standard and Record Ownership as User/Team.
In this case, the Student table has three names—Display Name: Student, Schema Name: school_Student, and Logical Name: school_student.
After providing these details, save the Student table. The table will be listed under the component list of the solution.
For any table, you can configure Columns, Relationships, Business Rules, Views, Forms, Dashboards, Charts, Keys, Commands, and Manage Data. You learn more about these options in upcoming sections of this chapter.
Working with Columns, Datatypes, Calculated Fields, and Rollup Fields
Click the table to open the table component to add or edit the columns. Columns are fields that store information about the student, such as roll number (auto-number), name, address, father’s name, mobile, email, and qualifications.
System Columns vs. Custom Columns
You can add custom columns as per your business needs. The custom fields can be identified by their Name, which is specified with the publisher prefix. The primary key is represented as <prefix>_<tablename>id, which is a 32-bit digit called a unique identifier. It behaves as a primary key of records.
Datatypes
Calculated Fields
Calculated fields are the fields for which values can be automatically calculated using conditions and formula in design time. These values will be automatically assigned to the field once certain conditions are satisfied. For example, if you want to store the next renewal date of a student automatically after the student is created, you can use the Feature Calculated field to auto-calculate the renewal due date and store that value. You don’t have to write any custom code,
Read more about calculated columns and their configurations at https://docs.microsoft.com/en-us/power-apps/maker/data-platform/define-calculated-fields.
Rollup Fields
A rollup field contains an aggregate value that’s computed over the records related to a specific record, such as unpaid payments. You can also aggregate data from activities directly related to a record, such as emails and appointments, and activities indirectly related to a record via the Activity Party entity. In more complex scenarios, you can aggregate data over a hierarchy of records. As an administrator or customizer, you can define rollup fields by using the feature, all without needing a developer to write code.
Read more about rollup fields and their configuration at https://docs.microsoft.com/en-us/power-apps/maker/data-platform/define-rollup-fields.
Column Name | Datatype |
---|---|
Address | Multiline text |
Father Name | Text |
Mobile | Phone |
Gender | Choice (Male, Female, Other) |
Qualification | Choices (MCA, MBA) |
Click the +Add Column option to create these columns. Set the Required option to Optional, Required, or Business Recommended, as needed. If the business need is to require a mobile number, choose Required here. If a field value is not mandatory, it can be defined as Business Recommended. That way, a plus sign appears next to the field, indicating it’s recommended. The system will not restrict record creation if you leave the field blank.
To add the Choice datatype field, you need to add items to choose the field by selecting the New Choice option. Every choice field has a Text value to display and a Value option to be used internally. You can change them if you want.
Read more about the Choice field configuration at https://docs.microsoft.com/en-us/learn/modules/working-with-option-sets/3-exercise.
Auto-Number Columns in the Dataverse
Set Prefix to STD, Minimum Digits to 4, and Seed Value to 1000. The preview will display as STD-1000, STD-10001, and so on.
Save the column after configuration and then save the table. Now, whenever you create a student record, the roll number will be automatically generated.
Configuring Relationships and Relationship Behaviors
Relationships in the Dataverse are between two tables. For example, a student might have multiple payments, and one student can register for multiple courses. So, for such scenarios, you can associate two tables with a relationship.
There are three types of relationships in Power Apps—one to many (1:N), many to one (N:1), and many to many (N:N). The 1 is the parent and the N is the child.
Configure a new table called Student Payment with Payment ID, Amount, and Terms columns and build a 1:N relationship between Student and Student Payment.
Column Name | Datatype |
---|---|
Payment ID | Auto Number |
Amount | Currency |
Term | Choice (1, 2, 3) |
Now add a relationship to the Student Payment table. The following diagram defines the relationship between Student and Student Payment.
A pair of tables. Table 1 titled students lists the roll number, full name, address, father name, mobile, email, qualification, and gender with their respective details on its right. Table 2 lists the payment id, student, amount, and terms with their respective details on its right. Tables are connected by arrows named 1 and N.
For every many-to-one relationship, a new lookup field will be created in the table, which represents the many; the lookup points to the table record, which represents the 1.
In this case, Student Payment represents the many, so a new lookup column is created called school_Student in the Student Payment table, which holds the student record.
Relationship Behavior
Relationship behavior defines how the parent records behave when you perform an operation such as delete, assign, share, and so on, on their child records.
Type of Behavior | Datatype |
---|---|
Referential | Referential behavior has two actions: Delete - Remove Link: You can delete a parent record and the related child records remain in the system. The lookup field that holds the parent record association will be blank. Delete - Restrict: Any related records can be navigated to. Actions taken on the parent record will not be applied to the child record, but the parent record cannot be deleted while the child record exists. |
Parental | Any action taken on a record of the parent table is also taken on the related child table records. |
Custom | Custom behavior for each possible action can be selected. You can define custom cascade behavior for operations such as Share, Assign, Un-share, Reparent, or Delete. Cascade All: Any action taken on a record of the parent table is also cascaded to the related child table records. Cascade Active: Any action taken on a record of the parent table is cascaded to the related active child table records. Cascade User-Owned: Any action taken on a record of the parent table is cascaded to the related child table records owned by the current, logged in user. Cascade None: Actions taken on a record of the parent table will not cascade to the related child table records. |
For the current scenario, use the Referential relationship behavior and the Restrict Delete operation.
This way, you can configure the relationship behavior as one-to-many or many-to-one only. For a many-to-many relationship, this type of behavior is not applicable.
You have now created all the tables and relationships for the school management system.
Working with Business Rules
Action | Explanation |
---|---|
Set Field Value | Use this action to set a value of a field. |
Set Default Field Value | Use this action to set the default value of a field. |
Lock/ Unlock Field | Use this action to make a field read-only or editable. |
Set Business Required | Use this action to make a field mandatory or optional. |
Set Visible | Use this action to hide or show a form field. |
Recommendations | Use this action to recommend some action to the user. |
Show Error Message | Use this action to display an error message. |
Scope of Business Rules
Scopes | Explanation |
---|---|
Entity | This scope ensures that the business rule will work on the client-side and the server-side. The business rule will run when you interact with data using table forms and will be applicable when you are creating records using server-side code, like plugins. |
All Forms | This scope will only applicable when you create records using table forms i.e., only on the client-side. |
Specific Form | This scope will only applicable when you create records using a specific table form, not all forms. |
You cannot use datatype fields in business rules. Business rules are table specific. So, to add a business rule, you have to open a table and select the Business Rule option.
Create a Business Rule
Business Requirement: Make the email field mandatory for all mail students.
Provide a Name, Description, and Scope as Entity and then click the condition box on the rule canvas to enable the property window.
Now you can configure multiple business rules for tables, based on your business needs. Make sure to choose the correct scope for these business rules.
Configure Views for Tables
Views are a subset of a table’s records, defined by a filter condition. For example, you can create a view to display students joined this year as a view so that you do not need to build the query every time to fetch data. Instead, you can select the view and get the data. Views come in three types—system views, custom views, and user/personal views.
System and custom views are those views that you configure inside a solution; they are visible or accessible to any user in the organization. System views are by default created by a solution, but custom views are manually created inside a solution. Personal views are created by users and are visible only to the user who created them.
System views cannot be shared because they are available to all users. Personal views can be shared by users, as they are created by specific users. You can use Advance Find to create personal or user views.
System View | Explanation |
---|---|
Active View | This view displays active records. |
Inactive View | This view displays inactive records. |
Quick Find Active View | This view displays records in the search option. |
Advanced View | When you search records in Advanced Find, this view is used. |
Associated View | This view is responsible for displaying records in a related table view. |
Lookup View | This view is used when you search records in a lookup control. |
Create a Custom View
Create a custom view to display only male students. For this requirement, you simply navigate to the solution and open the Student table, select Views, and then click Add View.
Once you have completed these steps, save and publish the view. You have successfully created a custom view. Now you can test it.
Table Forms Design and Layouts
Forms are user interface elements by which users can interact with datasource. You can use forms to create new records and update existing records.
Form | Explanation |
---|---|
Main Form | The default form that can be used to interact with table records. |
Quick View Form | Can be configured to display parent record information inside the child record form. |
Quick Create Form | Used to quickly create records of a table type with fewer data items. This form can be created if you have enabled the table setting for Quick Create form. |
Card Form | Used to display information in a card format. |
You can edit the form layouts as needed. The main form consists of three parts—header, body, and footer. Inside the body, you can add tabs, and inside tabs, you can add one or multiple column sections. Section can be used to hold one or multiple fields.
Form Security
Enable Fallback Form
Create New Forms
Edit Student Main Form
Chart Configuration and Dashboard Pinning
A chart is a graphical representation of table data. Charts can make data interesting, attractive, and easy to read and evaluate, which can help you analyze and compare your data.
In Power Apps, you can create bar charts, pie charts, tabular data, and so on. You can connect to the Dataverse table to display data in graphical images.
Create a Chart
Choose Name with Aggregation, Count: All, and Gender for the horizontal axis. This scenario creates a chart to display students by gender. The preview of the chart will be displayed on the Designer Screen. Save the chart. The chart can be used in model-driven apps.
You can create multiple charts for a specific table with different scenarios, such as students by payment, top five students with highest payments, students by joined on date, and so on.
Dashboards
To display multiple charts on a single page, you can use dashboards. You can choose a layout like two-column or four-column dashboards. There are two types of dashboards—table-specific and global.
When you create a dashboard in a table, you can only use charts from the same table in the dashboard; these are called table-specific dashboards.
Create a Dashboard
You can configure multiple dashboards for a single table to represent different strategic visual screens. Charts and dashboards can both be added in model-driven Power Apps as entity assets.
To configure global dashboards, you need to create model-driven Power Apps. Then you can add multiple charts, web resources, and insight tiles by connecting multiple tables on a single page.
Configure Table-Specific Dashboards
Dashboards configured inside a table are called table-specific dashboards. In these dashboards, you can only use the charts related to that table. You cannot use multiple tables in a table-specific dashboard.
For more information about dashboards, see the Microsoft site at https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/create-dashboard.
Concepts of Alternate Keys
Alternate keys are useful for third-party system integrations. Power Apps store their primary keys in GUID format. However, third-party systems do not use GUID format, so for system integration, you have to configure an alternate key. This is done by combining multiple columns to uniquely represent a row or record. To add an alternate key, navigate to the table, choose Key, and click Add Key.
The alternate key calls the UPSERT command in Power Apps. The UPSERT command will check the record to be inserted or updated, as per the key check.
Working with Data in the Dataverse
Business Scenario, Use Cases, and Implementation
1 | Systems should be able to combine different configuration and customization components in a package so that they can be distributed to other environments. | Configure Power Apps Solution and add required components to it for packaging. |
2 | The school management system must allow users to enter student information such as roll number (auto-number), name, address, father’s name, mobile, email, and qualifications. The system should capture course information and users should be able to record students joined. The app must create payment information with term facility and payment details. | Solution components include tables, fields, forms, views, and relationships. |
3 | The system should display student-level total amount to be paid by student and it should display the next renewal due date of the student after one year of joining. | The solution requires you to configure rollup fields and calculated fields. |
4 | Mobile number and email should be mandatory when creating students. | Use business rules to solve this business need. |
5 | The system should allow associate courses for students. One student can have multiple courses and one course can be chosen by multiple students. | Configure relationships and relationship behaviors. |
6 | The system should have a visualization to display courses by students joined and display students by joining date. | Configure charts for the solution. |
7 | The system should display a page of all visualizations for the Student table. | Create a table-specific dashboard. |
In the next chapter, you see how to work with Power Apps to leverage these Dataverse concepts.
Summary
Understanding Power Apps solutions
Working with table configurations and settings
Working with columns, datatypes, calculated fields, and rollup fields
Using auto-number columns in the Dataverse
Configuring relationships and relationship behaviors
Working with business rules
Configuring table views
Designing table forms and layouts
Chart configuration and dashboard pinning
Configuring a table-specific dashboard
Understanding alternate keys
Working with data in the Dataverse
Business scenarios, use cases, and implementation
The concept of Power Apps and a no-code, less-code platform
Working with Canvas apps in detail
Using Power Fx for Power Apps
Working with model-driven apps
Power Portal concepts and designing with deployment
Managing Power Apps
Business scenarios and implementations