Writing user IDs to a column and then removing them invidividually

Hello and happy holidays! I am building an app for my Dungeons and Dragons local group and I ran into a small issue.

I have a table for “Tables” at which players can play. Each table representing a separate entity. In the table I have a column named “players”.

Via each object in the “table” table, I want to allow players to enroll themselves and remove themselves. I would also like to display all players from the column “players” afterwards on each individual “table” object.

How would I go about doing that? I can’t seem to think of a way to do that efficiently and I also can’t find a similar question on the forums.

Any help would be appreciated! :slight_smile:

Use action to add a row with the User ID (row ID or User email from Users table), User Name, and whatever you need more… to leave the table… remove that row. Then, add an inline list element to display names from that table.

1 Like

Thank you for your reply! I have done as you suggested and created a "table_players " table, but now I want to take it one step further! I want to display a “Join table” button only if the player already doesn’t have a table. I have done that with a boolean which checks on the presence of the player id in the “table_players” table.

However, I also want to show the “Leave table” button ONLY if the user is sitting in the detail view of the table he just joined.

I’m really not sure how to do that tho…

Here is my current setup:

Do you have any suggestions how I would go about doing that?

Thank you in advance for your reply!

So you created a relation in the users’ table User ID to user ID in the game table… then you show the screen that is coming from that relation… then to leave, delete the row… it will delete that row because the user went to that row from the relation. If you want to keep that row, delete only the user ID from there, and the second action will be to go back

I assume you mean showing the button, on a details screen of a “Table”, only when the user hasn’t joined that “Table”.

Add a query to the “Table” Glide Tables (hereby called GT), check the “table_players” GT for entries that have the player_id equals to signed-in player’s ID, and “table_id” equals this row > ID.

If the query is empty, show the button to join.

If the query is not empty, show a “Leave” button that deletes the row that match the query.