cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
robymes
New Member

Dataverse for Teams support for many-to-many relationships

Hello everyone

I apologize but I don't really find anything around to solve my problem.

I'm building a Power App for Microsoft Teams, using the build environment directly in Teams, I know there are some limitations, but I don't understand how many-to-many relationships work in dataverse for Teams.
I've never built any powerapps before, I started directly in Teams, most of the app is ok, but there is something that I don't underastand, and all the documentation out there is for "regular" power apps.

I created two custom tables that I tried to relate with a many-to-many relationship, but the result is not what I expected and I don't know if I'm missing something or if something is wrong in the build environment...

first question: I expected a relationship table would have been created, but no sign of it. is it correct? or should Isee it in my table list?

second question: I expected a new field in both tables that references the other table related items, but non sign of it. Again, is it correct? Honestly I don't think so, but I'm not sure.
So basically I'd like to know if working in Teams is different in some way in this particular context.
Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
HSheild
Super User
Super User

Hi @robymes ,

 

Many-to-many relationships work in Dataverse for Teams the same way as they do for regular Dataverse. 

 

Q1. When you create a many-to-many relationship there is an intersect table created in the background but Microsoft have tried to simplify things so it is hidden and you can't access it directly.  Take a look at this article as it might help you work with N:N relationships in a Canvas Power App with Teams.

 

Q2. This is correct, new fields do not get created on either table with a N:N relationship 

 

If you want to see an intersect table that defines the N:N relationship you can create one manually.  You do this by creating a 3rd table and relating the other 2 tables to it with a N:1 relationship.  For example, you have tables A, B and C and you want C to be your intersect table and A & B to have a N:N relationship.  Create N:1 relationships between C and A, and also C and B such that entity C has two lookup fields that are A & B.  The additional advantage about the manual N:N relationship is that you can store additional attributes on entity C which describe the relationship.  A good example of this are tables to represent Hotel (A), Guest (B) and Booking (C) where the Booking table describes a relationship between the Hotel and the Guest (of which there could be many!)

 

I hope this helps

 

View solution in original post

2 REPLIES 2
HSheild
Super User
Super User

Hi @robymes ,

 

Many-to-many relationships work in Dataverse for Teams the same way as they do for regular Dataverse. 

 

Q1. When you create a many-to-many relationship there is an intersect table created in the background but Microsoft have tried to simplify things so it is hidden and you can't access it directly.  Take a look at this article as it might help you work with N:N relationships in a Canvas Power App with Teams.

 

Q2. This is correct, new fields do not get created on either table with a N:N relationship 

 

If you want to see an intersect table that defines the N:N relationship you can create one manually.  You do this by creating a 3rd table and relating the other 2 tables to it with a N:1 relationship.  For example, you have tables A, B and C and you want C to be your intersect table and A & B to have a N:N relationship.  Create N:1 relationships between C and A, and also C and B such that entity C has two lookup fields that are A & B.  The additional advantage about the manual N:N relationship is that you can store additional attributes on entity C which describe the relationship.  A good example of this are tables to represent Hotel (A), Guest (B) and Booking (C) where the Booking table describes a relationship between the Hotel and the Guest (of which there could be many!)

 

I hope this helps

 

View solution in original post

robymes
New Member

Thank you very much!

Cristal clear and detailed
I think I will go with manual solution, better to manage

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (20,208)