Adding a new class

Hi

I have a table that shows a list of classes. In another table, a list of students with a class column. Through a simple relation, the tables are linked so that each class has it’s own students. Glide 101, no drama, works perfectly.

Now what if a user wants to add extra classes and assign the existing students to some of these? So one student might be in 3 different classes, another student in 5 different classes (their regular class, and some special classes).

I have gone with a manual approach - make a Boolean column for each new class and check students in that class. Then I created a list of the special classes to give me an inline list, and then attach an inline list of the students filtered by the Boolean column for that class. It works, but it’s not dynamic and each one has to be done individually (there are 13 special classes!).

I’m using this approach until I figure out a more efficient method.

Another option is to use use an If then Else to convert the Boolean to the class name, and then create a relation, but again, this would involve having a separate relation for each special class.

I’m confident there’s a better way, I just can’t figure it out.

So each class has one or many students, and each student can belong to one or many classes, yes?

I’d probably have a Classes column in my Students table, and fill that with a comma separated list of ClassIDs.

From a UI perspective, you just need to present a choice component with a list of classes on your student details screen, and make it multi-select.

And in the table, it’s just a split text plus multi relation to match students to classes.

Or you could go the other way and have a Students column in your Classes table that’s filled with a comma separated list of StudentIDs.

Either way would work fine.

3 Likes

Wow, that was easy. So much easier now, thank you!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.