Multiple Key

Hello,
I’am starting with Glide …
I have an events table, a “players” table and an “Answer” table… I want players to register for an event by answering Yes , No or Maybe in the “Answer” table. …
I linked my Response.event column with the event.name table and linked the Response.player with the Players table…
How to prevent a player from answering several times (multiple lines) (Composit Id ? ) … and how to possibly offer him to change his answer … if he has already answered

Can you share some screenshots of your app flow. Are you using a form for players to respond?

Thank You Jeff
Table évenement


Table players

Table Answer

I use a form for "Respons " (in french it’s the table “Participe”

One suggestion. I would recommend storing RowIDs in the Participe table instead of event name and player name. If you ever change the name of a player, or change the name of an event, then that would break your relation, and your list of participants would be wrong.

Is your Joueurs table set as the user profile table?

First you need a template column in your Participe table that joins the event and player together. You will need to do the same thing in your Événements table, but first we need to get the current user. This can be done if your Joueurs table is the user profile table. You can join the event and the current user ina template column.

Once you have template columns in each table, then you can create a relation in the Événements table that links to the matching row in the Participe table for that user. This will allow you to either show different buttons or control different actions in a custom action depending on if the relation is empty or not.

1 Like

Thanks again Jeff for your help
No, my players table is not the users table… What should I do to make it users profile?
You say:
“First you need a template column in your Participe table that joins the event and player together…”
I do it with the id Event’s and IdPlayer’s?

“You will need to do the same thing in your Events table, but first we need to get the current user. This can be done if your Players table is the user profile table. You can join the event and the current user in a template column.”
How do I retrieve the current player?
Thanks

Is it safe to assume that your users are the players since they are the ones registering for an event? So really your user table and player table could be one in the same? You can change which table is your user profile table through the user profile configuration.

The only reason I ask if your player table is your user profile table is because it’s much easier to globally access a signed in user’s user profile row.

Yes, as long as you are writing the Event ID and the Player ID to the Participe table, then you can create a template column that will join those two values together. So you could give your template a value, such as E - P and replace ‘E’ with the Event ID from the row, and ‘P’ with the Player ID from the row.

In the Events table, you need to get the current signed in player’s ID populated on every event row. If you change your Player table to be your user table, then all you need is a template column, and set your replacement value to the signed in players ID from the User Profile. So for example, you could still have a template of E - P, Replace ‘E’ with the Event ID from the row, and replace ‘P’ with the player ID from the user profile.

Thanks Jeff
With your advice, I succeeded in my app !
I now have to know for each event the number of people who answered “yes”, “No”, or “Maybe” knowing that they answer with a Choice List…

I have another question… In my input form, I have a start date/time and an end date/time… I would like that after entering the start date, the end date is filled in automatically with a date value of part + 01:30 … I don’t see how to do …
Thanks