Canvas Apps Expressions Features

How to master Dataverse relationships in canvas apps!

Relationships in Dataverse
Relationships in Dataverse

Introduction to Dataverse

Dataverse is more than just a database - it stores data, provides different levels of data and much more. At its heart, it is a relational database and provides a rich set of relationships.

Relationships in Dataverse

There are a lot of different relational capabilities that are available with Dataverse. These include:

  1. One to many
  2. Many to one
  3. Out of the box many to many
  4. Custom many to many
  5. One to one
  6. Indirect
  7. Polymorphic lookups
  8. Choice columns
  9. Yes/No columns
  10. Connections (what's this?)

Model-driven apps are more straightforward when it comes to working with Dataverse relationships. Those same concepts, are slightly more complicated in canvas apps. A lot of questions get asked on the Power Apps community forums on these topics. Since a lot of makers work with SharePoint and other data sources, they find these concepts challenging when they switch to Dataverse. More than 90% of our projects at Hitachi Solutions use Dataverse as the datasource. Which is why Dataverse was the first database I was exposed to, as far as canvas apps are concerned.

Illustrations using a simple data model

Over the next few days, I plan to cover each one of them in detail. For each relationship, we will cover the following topics:

  1. Display related records
  2. Relate records
  3. Remove/delete relationships between records

We will be using a simple student management system as an example to illustrate all the different types of relationships. Here is the data model:

Student management system - data model
Student management system - data model

These are the relationships that we will be using in the blog series:

  1. One to many: one department can have multiple instructors but an instructor can only belong to one department
  2. Many to one: many courses can be taught by an instructor but one course can only be taught by one instructor
  3. Out of the box many to many: one student can enroll in multiple courses and one course can be taken up by multiple students
  4. Custom many to many: one student can enroll in multiple sports and one sport can be taken up by multiple students
  5. Indirect: relationship between an instructor and his/her students (via courses)
  6. Polymorphic lookups: record owners of any table in Dataverse
  7. One to one: personal details of students (e.g. SSN, DOB etc.)
  8. Connections: different types of relationships between a student and an instructor e.g. mentor/mentee.
  9. Yes/No & Choice columns: major of a student e.g. finance (Choice column) and whether he/she is an international student (Yes/No)

So stay tuned to learn everything you need to know about Dataverse relationships and how to use them in canvas apps!

PS: Links to each separate blog post have been added above. Also, I spoke about this topic at the Portland Power Platform Virtual Meetup on June 8th 2021. If you are interested in watching it, here is the link.

Recent articles

  1. How to calculate the height of a flexible height gallery!<.a>
  2. How to create custom errors in Power Apps!
  3. A-Z: 26 tips! Learn how to improve your Power Apps!

13 thoughts on “How to master Dataverse relationships in canvas apps!”

Leave a Reply