I have 2 collections, “students” and “courses” which are joined by a many-to-many relationship with a through table called “student_course”. For each student-course association, i would like to assign a grade and other metrics stored in a collection called “evaluation”. How can i do this?
You can create a separate evaluation collection, but this will make the structure more complex and harder to manage.
A better approach is to add the evaluation fields (like grade, score, etc.) directly to the student_course relation table, which already represents the student-course association.
This way, you can manage the many-to-many relationship and store evaluation data in one place, making the structure cleaner and easier to work with.
@shleyZ - Can you elaborate on how to get access onto the fields which exist on the pivot table when in forms / tables? I can only seem to access the other table defined in the many-to-many and can’t access fields on the pivot table.
You won’t be able to see or use the system-generated pivot table in the UI, so its fields can’t be accessed directly in forms or tables. If you need to store extra info on the relationship, the better way is to create your own intermediate collection instead of using the auto one. That way, the fields will show up normally in the UI and you can work with them just like any other fields.