In this beginner-friendly walkthrough, Pragmatic Works’ Nate Halliwell introduces how to identify and implement many-to-many (M2M) relationships in Power Apps Canvas Apps. Using a familiar school scenario—students and classes—he shows how to relate records, display related data in galleries, and control relationships with the Relate and Unrelate functions. He also contrasts native many-to-many relationships with a junction table approach for scenarios that require extra metadata like grades, teachers, or periods.
Nate frames M2M with a simple model: a Students table and a Classes table. In real life, one student attends many classes, and each class has many students—classic M2M. A single lookup column would only create a one-to-many (1:N) relationship, which can’t represent reality in this case.
Behind the scenes, Dataverse creates a virtual relationship “table” that tracks which students relate to which classes—no physical table is added to your solution. In Canvas Apps, this relationship becomes accessible as a related column; for a student record, you can reference ThisItem.Classes to get a table of related class records.
Nate demonstrates a simple management screen made of two vertical galleries:
The goal: when a class checkbox is checked for the selected student, the app creates a relationship; when unchecked, it removes it.
In the class gallery’s checkbox:
Relate(GalStudentMgmt.Selected.Classes, ThisItem) Unrelate(GalStudentMgmt.Selected.Classes, ThisItem) ThisItem.Class in GalStudentMgmt.Selected.Classes.Class.With these formulas, users can click through students and see checkboxes persist for existing relationships. Nate validates the approach by toggling classes for several students and confirming the state updates correctly.
Native many-to-many relationships are great for linking records quickly. However, they don’t store additional metadata about the relationship itself (e.g., a student’s grade in a specific class, the teacher, or the period).
For richer scenarios, Nate recommends a junction (joiner) table, such as StudentClass, which includes:
Example records for Nate might be “Nate Halliwell – Art – Grade 92” and “Nate Halliwell – Technology – Grade 95.” In the app, you can place a gallery filtered to the selected student’s StudentClass records and edit those metadata fields directly.
.Classes).Relate and Unrelate provide simple, reliable control of relationships at runtime.By following Nate Halliwell’s step-by-step setup and formulas, Canvas App makers can confidently model many-to-many scenarios and choose the right data pattern for current and future needs.
Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Canvas Apps and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.