cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CNT
Super User
Super User

Many-to-Many Relationship

Hello
I have a M-to-M relationship between two entities User and Location (Custom entity). I've used the Relate function to relate the records from these 2 entities and that works fine.
I my Canvas app I have 2 galleries - One for User and the other for Location.
 
In the Item Property of the Location gallery when I use the following formula, it shows the related Locations only for me (I am a Global admin).
galSelectUser.Selected.Location
But when I use the following formula (where cxe006_SystemUser_cxe006_Location is the name of the relationship), it shows the Locations for all users.
galSelectUser.Selected.'Location(cxe006_SystemUser_cxe006_Location)'
 
Any idea why it works like this. Is this a bug? 😡 or is there any valid reason for this behaviour. Any help would be greatly appreciated.
 
Thanks
 
4 REPLIES 4
Drrickryp
Super User
Super User

Hi @CNT 

My reading of https://powerapps.microsoft.com/en-us/blog/relate-records-in-many-to-many-relationships/  indicates that the First() function has to be used in displaying the data in a Many to Many relationship. 

Hi @Drrickryp FIrst() is needed only if u need the first related record. I found that you have to refer to the relationship name and not the entity name. This seems to be a mistake in the documentation.

@CNT 

Good to know.  It sounds like you found the solution to your question?  If you did, could you post how you were able to do it in your app?  I still feel more comfortable creating my own junction tables rather than using the built in relationships. 

HI @Drrickryp 

Yea, but the documentation is so misleading and needs fixing to save time and effort for others.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (4,580)