Dataverse Many to Many Relationships

It can be a little tricky to work out how to navigate the many to many relationships between Dataverse tables

Let’s look at the many-to-many relationship between the Teams and User tables. A Team can have many users and a User can belong to many teams

The key to being able to traverse the relationship is to find the name of the many to many relationship between the 2 tables. This can be identified from either table

User Table Relationships

dataverse user table

Team Table Relationships

dataverse team table

Table Navigation

I want to be able to display all the Teams that I am a member of. To do that I create a canvas app and add the User and Team tables

Having created a gallery, to display all the Teams I am a member of, set the Items the property of the gallery:

LookUp(Users,'Full Name'="Chris Harper").teammembership_association

The formula works by getting my user record and then traversing the many-to-many relationship to display all my associated teams

Similarly, I can display all the members of a the Developers team in a gallery with this Items property:

LookUp(Teams,'Team Name'="Developers").teammembership_association

When typing the relationship name, Intellisense offers you the options below that work equally well:

LookUp(Users,'Full Name'="Chris Harper").'Teams (teammembership_association)'
LookUp(Teams,'Team Name'="Developers").'Users (teammembership_association)'

Many of the standard Dataverse tables have lots of relationships and the many options presented by Intellisense can be confusing. Knowing the particular relationship name you are wanting to use will save a lot of frustration!

2 thoughts on “Navigating Dataverse Many to Many Relationships”

  1. Very useful post. I’m wondering if from my powerapps app, i can add members to a user/owner team based on selection of emails from a combobox?

    1. Yes, that is possible. Either access the teammembership table directly from your Power App to create the records, or use a flow. Ensure the app user or flow owner has the necessary security roles assigned to access and write to the table.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top