Attendance functionality and arrays as variables

Trying to put together a proof of concept for using a Glide app to keep track of attendance for a social sports league. I have two tables in an Airtable database (players and games). I added a button for each game to mark that they will be attending and a table that shows the players that entered this value.

Originally, I was hoping for a way to directly update a row via glide, but I haven’t been able to see it in the list of actions (sorry if this does exist, I just started playing around with this today). Not finding this, I found a work around via Zapier to update my Airtable ‘games’ table and add the logged in users name to the record.

Then while testing this for a use case where there are already users in the attending table, so I had to add an additional ‘value’ in the Zapier trigger for the current attendees. This is where I got stuck as glide will not recognize an array as a variable for this. i.e. When the value is blank (value=“”), everything works fine. When the value is 1 name (value=“Kevin”), everything works as expected. However when the value is 2 or more names(value=[“Kevin”,“Tom”]), the value disappears as an option in the drop down for the Zapier integration and it removes the other users and only shows the recently added user as attending.

Is there a way to treat an array value as a variable for an action? Is there a better way than Zapier to append another value to an array? Is there an entirely better way to achieve the result of showing who is attending each game?

In Glide you would use a Choice component with multi-select enabled to achieve this.

The source for your choice component should be a column that contains your list of Players, and the target should be the appropriate column in your Games table. If a user selects two or more players from the list, the result will be written to the target column as a comma separated list.

If you then wanted to relate that back to your Players table, the way to do it would be to first use a Split Text column to create an array from the joined list, and then use that in a relation column, matching with the names in your Players table.

Note that it’s generally considered a better practice to add a RowID column to your Players table, and use this as a PlayerID. So instead of writing a joined list of names via the choice component, write a joined list of PlayerIDs. This is a more robust approach and wont break if - for example - a player changes their name, or a players name contains a comma.

1 Like