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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (984)