Update column value not working

Hey there –

I have two tabs for the same type of data in my app, one to “Check In” drinks from Events and one to “Check Out” drinks from Events. The first step on each is to select an Event from the list, and then the user is presented with a list of Drinks that were assigned to the event. Finally, the user taps into a Drink to set how many were Checked In or Checked Out.

So that I can have a different screen layout when viewing the final screen (the drink inside the event), one tab is a List the other a Detail with an Inline List (as far as I understand, this is the only way to have unique layouts when using the data from the table.)

Now, the issue I’m having is that I need a button on each Event that can Mark the Check In / Check out as complete. This is done with a custom action that updates the column value.

It works as expected for Check In (where I’m updating the item directly) but for Check Out it doesn’t update the value (where I’m updating the related/linked item).

Here’s a screen share with a demo of the issue: Screen Recording 2022-09-23 at 6.33.20 pm

Just for laughs…what happens if you delete and recreate the mark complete “check in” button?

1 Like

Is your “Event” relation a single or multiple relation?

With the Show New Screen action, you can create as many new (unique) screen layouts of data from the same table as you want to.

Ok tried that and discovered something strange… it always seems to apply the column value change to a different event: Screen Recording 2022-09-26 at 10.54.49 am

An Event can have many Drinks and a Drink can be assigned to many Events.

From your video, it seems pretty clear that your relation is matching the first row in the target table, so it’s always the first row that gets updated.

Can you show/explain how your relation is created?

Just as an aside, having separate tabs/screens for check in and check out isn’t really necessary, and doing that is probably creating extra work for yourself.

The screens look relatively simple with not too many components, so you could probably do the whole lot on a single screen and then use visibility based on event status to show/hide components, change button labels, etc. And then do the same with your actions, eg. “if checked in is true, do this, else do that…”

If you set it up that way, it will be easier to maintain and the problem you have now will go away.

I’m using Airtable as my data source and here’s how its setup: Screen Recording 2022-09-26 at 11.11.21 am

There’s an Event Stock table which lists each item with a single relation to the Drink and Event that the item is assigned to.

Interesting. I will have a think about this. In that case, could I still have two tabs in the menu or would it need to be a single tab where I have a filter at the top to allow the user to filter between event statuses?

You could do either. The main point is that you only need to configure a single details screen and it can serve as both check in and check out.

2 Likes

ah, okay - AirTable. I guess they are called AirTable linked fields? (I’m not an AirTable user).

I’m not exactly sure how they work, but from watching your earlier video it seems pretty evident that an update via that column is setting the first row.

Anyway, when I asked about your relation I was assuming it’s a Glide relation column.

1 Like

I have taken your advice and rebuilt the screen using your suggested method and it now works!

Thank you :pray:

2 Likes

Excellent! :+1: