Ask Learn Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When you're storing or viewing data with your app, an important part of the design is the data structure. You should consider how the data is used in one specific app or screen, in addition to how others use the data. Referring to your personas, tasks, business process, and goals helps you define what data to store and how to structure it.
Dataverse has three table types:
When you create a custom standard table, you must specify its ownership:
Activity tables are used to store interactions. They have a relationship to all tables that have Enable for activities set on their table metadata. Activity tables share the same set of columns and share the same security privileges. Rows in activity tables appear in the timeline on model-driven app forms. In this example, a custom activity table called Donation has been created.
Advantages for using custom activity tables are that they:
Major disadvantages of using custom activity tables are that they can't:
You need to choose the data type for columns wisely. This notion is especially true for numeric data types because you can't compare numeric columns with different types, and restrictions are placed on data types for calculated and rollup columns. After a type has been chosen, it can't be changed.
Data type | Comments |
---|---|
Yes/No | Ensure that you never need more choices |
File and Image | Allows you to store file and images inline in Dataverse |
Customer | Can be either contact or account |
Lookup/Choice | Make sure that you choose the best one |
Date/Time | Make sure that you choose the appropriate behavior |
Numeric | Many to choose from, so choose wisely |
How you decide between using a lookup table or a choice table depends on the circumstances.
Use a choice table when you want a table that:
Use a lookup table when you want a table that:
Storing other data on the lookup table allows you access when you're running workflows or other customizations that reference the data. For example, a related property can be used in a check condition.
By being a solution component, a choice table handles merge resolution by prefixing the value with the publisher prefix.
Adding values on a choice table requires administrator/customizer level access, while lookup values can be changed by a user if they're granted permission through security roles.
The user experience (UX) for choices is ideal for small quantity but doesn't work well for large sets. Lookups provide search type features that aren't available on choices.
If you have multiple choice columns that are dependent on one another, this task can only be achieved with form-based script, while lookups can be filtered on other lookups by using configuration.
You have several choices of where to store files and images:
Characteristics of file and image data types:
Calculated columns allow simple calculations to be performed on data in a row and they:
Rollup columns allow aggregations for related rows in one-to-many relationships and they:
You can roll up "simple" calculated columns, that is, calculated columns that include nondeterministic functions can't be rolled up.
Relationships define how rows are related to one another in Dataverse. Each table in Dataverse has a primary key to provide a unique reference to the rows in the table. In Dataverse, the primary key is a globally unique identifier (GUID) that is generated automatically by Dataverse when a row is created. Relationships are created by adding a reference to the primary key, which is known as a foreign key. In Dataverse, relationships are created by using a column on one table to hold the foreign key value. This foreign key is a pointer to the primary key on the other table.
Two types of relationships are supported in Dataverse:
The following expense report shows an example of a one-to-many (1:N) relationship.
The preceding screenshot shows the main part of the expense report, which has the employee name and department details. Below the main part are multiple rows of descriptions for each purchased item. For this example, these descriptions are called line items. The line items have a different structure from the main part of the expense report. Therefore, every expense report has several line items.
The relationship between the expense report and the line item is an example of a one-to-many (1:N) relationship. The main part of the expense report is linked to several line items. You can also view the relationship from the perspective of the line items: Each line item can only be linked to one expense report, which is a many-to-one (N:1) relationship.
A multiple-to-multiple data structure is a special type and it's used for cases where multiple records can be associated with multiple sets of other records. A good example of a multiple-to-multiple data structure is your network of business partners. You have multiple business partners (customers and vendors) that you work with, and those business partners also work with multiple colleagues of yours.
The following sections provide examples of different types of multiple-to-multiple data structures.
The following example show two sets of data: one that represents the employee and the other that represents the time-off request. Because each employee submits multiple requests, the relationship in this scenario is one-to-many, where "one" is the employee and "many" are the requests. The employee data and time-off request data are related to one another by having the employee number as the common column (also known as the key).
In this example, the data structure looks sophisticated but is similar to the expense report example that was discussed at the beginning of this article. Each vendor or supplier is associated with multiple purchase orders. Each employee is in charge of multiple purchase orders. Hence, both sets of data have a one-to-many data structure.
Because employees might not always use the same vendor or supplier, vendors are used by multiple employees and each employee works with multiple vendors. Hence, the relationship between employees and vendors is many-to-many.
The following example shows an entity relationship diagram (ERD) that contains multiple tables for an expense reporting solution.
This example features two VIPs: John and Mary. John has chosen the WiFi and Laundry benefits, and Mary has chosen the WiFi and Mini-bar benefits. You can model this scenario in different ways. The first way is to model the scenario as a 1:N relationship.
In this configuration:
The second way is to model the scenario as a N:N relationship.
In this configuration:
Neither configuration is ideal.
The next example shows the creation of a custom (interset) table to hold the VIP's benefits.
This configuration:
The following example shows the use of columns on the Contact table.
This configuration:
This configuration is a good example of when the benefit must be recorded for some compliance/statistical purpose but has no impact on the business or processing.
Relationship behaviors control how certain actions cascade down to rows that are related to the primary table row through the 1:N relationship. Behaviors maintain referential integrity and can prevent orphan records from being left behind.
Important
Defining relationship behaviors is important because the cascading of assigned records can cause related records to be assigned. If in doubt, set the behavior to Referential and Restrict.
Alternate keys are used in integrations to reduce the need to perform a query to find a record. By using an alternate key, you can update a row without knowing its GUID.
Alternate keys:
When a key is created, the system validates that that key can be supported by the platform.
When creating ERDs for Dataverse, you should:
Please sign in to use this experience.
Sign in