In this Pragmatic Works training video, Nate Halliwell explores how to replace traditional many-to-many relationships in Dataverse with a more flexible solution: junction tables. This method not only simplifies data modeling but also enables the storage of additional metadata about relationships that many-to-many models cannot easily support. The video builds on Nate’s previous lesson about many-to-many relationships and demonstrates how to structure, implement, and use junction tables inside of Canvas Apps.
To start, Nate reviews the concept of a many-to-many relationship with a familiar example: students and classes. In a simple setup:
In Canvas Apps, these relationships are easy to establish using Relate and Unrelate functions. However, the limitation is clear: while the relationship itself is stored, there is no space to capture extra details such as grades or enrollment metadata. This is where junction tables come in.
A junction table—also called a joiner table—bridges two tables and stores individual records for each unique combination. For example:
Each record links a single student with a single class, making it possible to include an additional column to store metadata such as the student’s grade. Unlike invisible system-managed tables, a junction table gives full flexibility to extend the relationship model.
Nate demonstrates the steps to build a junction table in Dataverse:
This setup allows each student-class combination to exist as a record with additional information attached.
After building the table, Nate walks through incorporating the junction table into a Canvas App:
Patch function to create new records in the junction table when a class is selected.Remove function to delete a record if a class is deselected.This design ensures that the relationship is dynamically updated whenever checkboxes are selected or cleared.
The real power of the junction table comes with metadata. Nate creates a gallery to display all records for the selected student, filtered by the student ID. Instead of showing auto-numbers, the gallery displays class names linked through the lookup.
Finally, he adds a text input field to capture grades for each class. By using the Coalesce function, the app displays “0” as a placeholder if no grade is entered. When a value changes, the OnChange property patches the new grade back to the junction table, ensuring that the metadata is saved and retained across sessions.
By the end of the demo, Nate highlights the advantages of junction tables compared to standard many-to-many relationships:
Nate Halliwell’s demonstration makes it clear that junction tables are not as intimidating as they sound. They provide a straightforward, powerful way to replace many-to-many relationships while unlocking the ability to store and manage metadata. For educators, developers, and app builders, this technique is invaluable when working with complex data models inside of Dataverse and Canvas Apps.
Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Dataverse Power 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.