Removing Add Button from Inline View based on contents of another Cell

Not sure the best approach here. I have two main tables for an app that logs check in and check out dates of Maps.

Maps[Map(key), Name, Town, Status]
and
History[Key, Map, Check In(date), Return(date)]

When a map is checked out the return date is left blank. The “blankness” of that return date drives the Status column in the Maps Table (Google Sheets Side) by an arrayformula that applies “In” “Out” or “Overdue”.

Over to Appsheet, In my UX i have Maps_Detail that has related history in it. It shows all the checkouts and checkins for that map.

What i can’t work out is how to hide the “Add” button in Maps_Detail View if there is a blank return date assiciated with that map already Or if the Status for that map is “Out”.

I’m currently messing around with Behaviour > Actions > [History] > Add (system generated) > Behaviour > Only if this condition is true:

AND(
NOT(IN( CONTEXT(“View”), LIST(“Maps_Detail”))),
COUNT( FILTER(“History”, AND( ([Map] = [_THISROW].[Map]), ISBLANK([Return])))) = 0
)

I don’t think i’m approaching this is the right way, some guidance would be appreciated.

Thank you

Tris

Solved Solved
0 6 2,027
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

The system-generated Add action is not aware of the current row, so you cannot reference _THISROW within its Only if this condition is true expression.

To accomplish what you want, I suggest creating a read-only slice on the History table. In the Maps table, you’ll need two columns that contain the same list of History table references. One will have a Source table of the History table itself, the other will have a Source table of the read-only slice.

3X_8_f_8f9bf3c4d441a1b678f77e3cb416c008bfc152ca.png

Add a Show? expression for each of these two columns so that only the first is shown when Add is allowed, but only the second is shown when Add is not allowed.

See also:

View solution in original post

6 REPLIES 6
Top Labels in this Space