Hi Guys,
does anyone have some experience on the following topics?
How can you define and write relationships (many to many) in CDS?
Thanks
Hi @Anonymous,
To create a many-to-many (N-N) relationship you have two options in CDS:
To create/update the record and relationships, it is fully supported with the CDS Web API which is what the Connector uses. Here's more details this and suggest to have a quick read: https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/create-update-entity-relationships-using-web-api
For you 2nd question, members of Access Teams are just user records. To add/remove, all you need to do is create/delete the membership record for that Access Teams. There are two API operations to achieve this:
Hope this helps!
Hi @Anonymous
I prefer to handle M:M relationships by creating a junction table as a separate entity. Then, I can address the one to many relationships from either side of the junction table. This approach has the advantage that I can add additional fields to the junction table. A feature that cannot be done using the "built in" relationships created by CDS. https://powerusers.microsoft.com/t5/News-Announcements/Relational-Database-Principles-and-PowerApps-Step-3-Keys-and/ba-p/188640 has an example of the junction table in a paradigm of Students and Classes with the additional feilds that would most appropriately be found in each table.
stampcoin
17
mmbr1606
15
Super User 2025 Season 1
ankit_singhal
11
Super User 2025 Season 1