I would like to design a signup system where students can volunteer for an event.
I have three tables:
- Users: Contains columns [Name] and [Email].
- Projects: Contains [Project Name] and [Project Goals].
- Events: Contains [Event Name] and [ProjectID], which is a reference column for the Projects table.
The app workflow is as follows:
- A project is created.
- An event associated with the project is created.
- At this point, I want users to see the event created in step 2 and be able to sign up for it.
How can I set this up?
You could try the following
-
Add a table called say “Event Registration” as a child table to the Events table. The users can then register themselves. You could add suitable logic to ensure that a user can only add her/his own record( by adding suitable expression in the add action )and she/he can add the record only once by adding suitable valid_if expressions in the [Name] and [Email] columns of the 'Event Registration" table. The name and other any details of the user can be pulled from the Users table based on email of the logged in user.
-
Alternatively, add an enumlist column called say [Users Registered] in the Events table. Then add an action to collect users name as an when they add themselves. Here also you can pull the name of the person registering from the USers table based on logged in user’s email. Also in the action condition, you can add an expression to ensure that a name does not exist twice in the enumlist column [Users Registered] . One point to note is AppSheet’s security filters are row based. So if you wish other users should not know who has registered, this approach of creating an enumlist column may not work because enumlist will show names of all the users registered for the event.
1 Like
Thanks for your reply @Suvrutt_Gurjar ! When exactly did you mean when you said, “Add a table … as a child table to the Events table”? How would I do that?
What I mean is " add a new table called say Event Registration in the app. This table will be a child table of the Events table"
Please note that I have given 2 suggestions based on the little info shared by you. Please thoroughly evaluate fitment of any approach in your overall app design.
1 Like
Ok, how exactly can I make / turn my table into a child table? I am not quite sure what steps are involved. I would appreciate it if you guide me through the process. Thank you.
It is the same way you have made the Events table as a child table of the Projects table.
When you add a reference column in table B to reference table A, the table B is said to be a child table of table A.
So in the Events Registration table, you will add a reference column that references the Events table.
1 Like