Decrease by 1 everytime user "checks-in"

I have seen a couple of threads that touches on this topic but no concrete path to solve what I want to achieve.

I’m building a client app for a dance studio where a user can purchase different packages to attend dance classes eg: Full Term (6 weeks), Casual Class (Single class), 10 Class Pass, etc…When a purchase is complete the details of the purchase are copied to a separate sheet called ‘Purchases_Completed’ including the number of classes included in the purchased package eg; 6 (full term), 1 (single class), 10 (class pass)

I have also created a calendar view of all scheduled classes with the ability for a user to “Check-in” (via a form button, which when submitted creates an item on a sheet called ‘Check-ins’)

Every time a user ‘checks-in’ into a class, I want to decrease the number by -1 in the corresponding column of the ‘Purchases_Completed’ sheet?

Count the number of check-ins, then subtract that from the number of classes. For now you’ll need to do this in the sheet with SUMIF

Thanks David, I was able to make this work with what you suggested.

I am using this value to un/hide a “Check-into Class” button displayed in the user profile screen (filtered by signed-in user) which works perfect (shows-up when the user has >0 classes remaining and hides otherwise). When the button is displayed it takes you another screen that displays the Classes (in a calendar view). In the details page of each Class screen I have a “Check-in” button which creates the actual “check-in” list item and the formula to decrease by -1 works perfectly after that.

The problem I have now is that I have a separate tab that is also displaying the scheduled classes in a calendar view, the “Check-in” button for each class is also visible to all users even those that don’t have remaining classes available. Deleting the button from this view also removes it from the user that has classes remaining. It appears that navigating to the class via the profile view takes you to the same view (hope that makes sense, as in, having two separate screens with a in-list using the same sheet, making a change to the detail view of one impacts the detail view of the other). There is no relation between the class and the current logged in user and so a visibility condition can’t be applied.

What can you suggest to actually hide/un-hide the “Check-in” button in each Class details view for those that have classes remaining vs not?

In your scheduled classes tab, is the tab only a view-only display of the classes (meaning that the user cannot edit any records)? If so, then I would create a clone of the sheet classes sheet to use for the scheduled classes tab. Details layout are always tied to a sheet, so if you change the components on one view it will change for all other views that refer to that same sheet.

thanks Jeff - this worked :slight_smile:

1 Like