Register for one class per session block

Hi, I’m working on a conference app where users can register for one class within a session block. Each session block contains five classes happening at the same time, and users should only be able to sign up for one class per block. How can I prevent users from registering for multiple classes within the same session block?

There are multiple ways to do things in Glide.

For example,
If you have a table for sessions… then when a user books a class in that session, you block him from booking any other class with the same session ID.

If you don’t, then you could have a query of classes the user has booked and a different query for classes that the user can no longer book. (classes that have the same start date/time as a class that has been booked). When the user tries to book a class that is in that list he is not allowed.

1 Like

Hi @abdo - Thank you for your response. Per your comment,

If you have a table for sessions… then when a user books a class in that session, you block him from booking any other class with the same session ID.

This is exactly what I’m trying to do. But how would you go about this?

As mentioned, there are a lot of ways. If you break it down, the simplest method could be to create a query or relation linking the session table to the registration table by linking the session ID as well as the signed in user email or ID. Then it could just be a matter of filtering a list where the query/relation is empty or only showing a form button when the query/relation is empty.

It largely depends on how you have designed your app flow. Just break it down into small pieces. If something can’t happen when a certain condition occurs, then you need to figure out how to determine what constitutes that condition being true or not. Then determine what you want to do when the condition is true or not true. It’s really hard to give a straight answer without knowing much about your database structure, app flow, or how someone registers for a session on your particular app.

2 Likes