Introduction
One of the most useful things in Datavese is the ability to create relationships across the environment, this gives the ability to bring in data from other tables into one form, create subgrids and reference that information across your apps.
There are 3 types of relationships in Datavese these are:
- 1 to Many
- Many to 1
- Many to Many
Unfortunately there is no 1 to 1 relationship in Dataverse currently.
Viewing Existing Relationships
To view existing relationships go to the Table and under ‘Schema’ section go to Relationships from there you will see a list all of the relationships associated on that table.
- Display Name is the name that appears on the form/ column.
- Name is the logical name for the relationship this cannot be changed
- Related Table is the table the selected column relates to which data can be surfaced to or from
- Relationship Type is the type of relationship that is associated with the selected column, This can either be Many to one, one to Many or Many To Many
Creating a 1 To Many Relationship
To start creating a 1 to many relationship you must first have created a Dataverse Table, add a new column and choose ‘Lookup’ as the data type, then select the related table you want to make the relationship with.
This relationship, will now be visible in the relationships section of the table. If we now onto the form we can see the column and the values from the related table.
Many to Many Relationship
Unlike one to many and many to one relationships you don’t need to create a new column for this relationship instead a virtual table is created to accociate these relationships.
To create a Many to Many relationship go to ‘Relationships’ within the table, click ‘New Relationship’ and select ‘Many To Many’.
Enter and select the table you want the relationship to be between:
Confirm you are happy with the ‘Relationship Name’ and ‘Relationship Table Name’ and click ‘Done’
The relationship will then exist in the Relationships view
Limitations
With many to many there are a few limitations to keep in mind when deciding to use One-to-Many or Many-to-Many relationships. Some of the known limitations are:
- Look- Up – No Lookup columns can be surfaced on the form
- Form Limited visibility – many to many relationships don’t have a column and will not be visible to the user on the form. Must be surfaced using subgrid
- No View Visibility – When trying to view the data from a view and not a form, the column is not visible and cannot be added
- Data Complexity – More complex in using Flows and Workflow, especially with listing out records