# Configuring "book a class" visibility conditions

**URL:** <https://community.glideapps.com/t/configuring-book-a-class-visibility-conditions/82740>\
**Category:** Ask for Help\
**Created:** [June 25, 2025, 7:39pm UTC](https://community.glideapps.com/t/configuring-book-a-class-visibility-conditions/82740 "2025-06-25T19:39:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LegacyInspiredFilms](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/legacyinspiredfilms/32/89672_2.png) [@LegacyInspiredFilms](https://community.glideapps.com/u/LegacyInspiredFilms)\
**Post date:** [June 25, 2025, 7:39pm UTC](https://community.glideapps.com/t/configuring-book-a-class-visibility-conditions/82740/1 "2025-06-25T19:39:18Z")

</div>

Hi,

I’m fairly new to Glide and I’m having trouble configuring the visibility settings for a “book a class” button for a gym app. When I add the visibility settings the button disappears and I’m pretty sure it’s because I have the data table wrong. Attached are screenshots of the current configurations. I would appreciate the help with this.

 ![Screen Shot 2025-06-25 at 2.34.09 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/7/0721200f3dfa3c619de625219ae2525afabb0616.jpeg)  
 ![Screen Shot 2025-06-25 at 2.34.41 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/c/fcb466560319e9dc65f4336dd35f73f8074140ed.png)  
 ![Screen Shot 2025-06-25 at 2.35.09 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/a/7adbe08e5d51124ec64101261be2998cea325121.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 25, 2025, 11:49pm UTC](https://community.glideapps.com/t/configuring-book-a-class-visibility-conditions/82740/2 "2025-06-25T23:49:17Z")

</div>

Can you show us what visibility condition you set up for the button? Is it when “Time Until Class” is \> 0?

You can also try “Start Time” is after Now, but I take it you want to calculate and leave a buffer, say bookings can be made until 24 hours before the class starts, for example.

---

<div class="post-metadata">

**Author:** ![Nicolas\_Joseph](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nicolas_joseph/32/76105_2.png) [@Nicolas\_Joseph](https://community.glideapps.com/u/Nicolas_Joseph)\
**Post date:** [June 26, 2025, 12:57am UTC](https://community.glideapps.com/t/configuring-book-a-class-visibility-conditions/82740/3 "2025-06-26T00:57:25Z")

</div>

Hi @LegacyInspiredFilms and welcome!

Based on your screenshots, I assume you’re trying to display a button only when these **two conditions are met** :

1. The Class should start in **more than 15 minutes** (after that, it’s _too late_).
2. At the time you click the button, there is **at least one spot available**. We can check this by subtracting the number of already booked spots from the `Max Capacity` column (otherwise, too many people would be in the Class)

To summarize, you have one problem for each point:

1. **Time calculations** are (sometimes) a pain in Glide - not because of the tool but because of JavaScript 😃
2. You need to calculate the **number of available spots** before using it in a Visibility condition

  

What is really cool is that i’s quite easy to deal with both points so here’s how 👇

* * *

### Is there more than 15 minutes before the Class?

- Instead of using a _Math_ column, I recommend using a _Date Difference_ one. That’s because when you apply the condition, I honestly don’t know how it is regarded: for example, does your condition _greater than 15_ means 15 hours? 15 days? 15 seconds?  
Even if it’s user-friendly, the format ##:##:## might result in strange behaviour when interpreted by a computer.

  

- Create a `Math` column to convert the day duration into minutes, just like in this `Date Difference (minutes)` example:  

  

> Now, the visibility condition can easily be applied to that column and will work perfectly 👍

Just a side note here: in the first column, `Date Difference (days)`, I tried using _minutes_ instead of _days_ and it’s working on my computer.  
However, according to Glide official documentation, valid values are _days, weeks, months, or years_ (cf. [Date Difference | Glide Docs](https://www.glideapps.com/docs/date-difference)), so that’s why I prefer to give you this option we an additional _Math_ column.

* * *

### Is there at least 1 available spot?

You already have a `Max Capacity` column in your **`Classes`** table, which is great. Now you need to also know how many people already enrolled this Class.  
This information is probably available in your **`Bookings`** table - a very clever way to organize your data, well done!

I guess the structure of this table looks like this:

| Class Name | User |
| --- | --- |
| HIIT Blast | [alice.dupont@email.com](mailto:alice.dupont@email.com) |
| Power Yoga | [bob.martin@email.com](mailto:bob.martin@email.com) |
| Strength 101 | [charlie.legrand@email.com](mailto:charlie.legrand@email.com) |
| HIIT Blast | [diane.rousseau@email.com](mailto:diane.rousseau@email.com) |
| Power Yoga | [eve.bernard@email.com](mailto:eve.bernard@email.com) |

  

- In your **`Classes`** table, create a _Relation_ column (let’s call it `Applicants`). Relate to items where the value in `Class Name` matches the value in `Bookings > Class Name`. Check _Match multiple_.  
This is going to help us counting the number of appliants, by adding a second column…
- Create a _Rollup_ column and Summarize the values of `Applicants > User` by calculating the Count
- Lastly, create a _Math_ column to compute the difference between `Max Capacity` and the column created in the last step 😉

> Now, the visibility condition can also easily be applied to that column. If someone saves a spot, the calculation will automaticaly be updated. Everything’s nice and robust.

* * *

Hope this is helpful to you and that my assumptions are correct 👍
