# Increment only if after set time?

**URL:** <https://community.glideapps.com/t/increment-only-if-after-set-time/23760>\
**Category:** Ask for Help\
**Created:** [March 4, 2021, 1:04pm UTC](https://community.glideapps.com/t/increment-only-if-after-set-time/23760 "2021-03-04T13:04:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan76](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dan76/32/15696_2.png) [@Dan76](https://community.glideapps.com/u/Dan76)\
**Post date:** [March 4, 2021, 1:04pm UTC](https://community.glideapps.com/t/increment-only-if-after-set-time/23760/1 "2021-03-04T13:04:25Z")

</div>

Hi

I am wondering if I can switch off the increment action on any tiles that have already had an increment action occur within 15 seconds prior. After the 15 seconds, the increment action would switch back on.

It needs to be per tile, so if I have 25 tiles, the increment is only switched off for those that fit the criteria above, while others keep the increment action switched on.

Not sure if possible?

Dan

---

<div class="post-metadata">

**Author:** ![Mishta\_P](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mishta_p/32/16900_2.png) [@Mishta\_P](https://community.glideapps.com/u/Mishta_P)\
**Post date:** [March 4, 2021, 1:09pm UTC](https://community.glideapps.com/t/increment-only-if-after-set-time/23760/2 "2021-03-04T13:09:21Z")

</div>

You should be able to do that with a custom action and the now time.

When someone increments, set a column, let’s say incrementtime to now.

Set a visibility to be active on now +15 seconds.

Hopefully that makes a small amount of sense.

---

<div class="post-metadata">

**Author:** ![Dan76](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dan76/32/15696_2.png) [@Dan76](https://community.glideapps.com/u/Dan76)\
**Post date:** [March 4, 2021, 1:27pm UTC](https://community.glideapps.com/t/increment-only-if-after-set-time/23760/3 "2021-03-04T13:27:04Z")

</div>

Hey Mishta\_P

I’ve set up an action, is this kind of what you meant?

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/b/eb649efaa3b9b7ece1759620571cfdd0cb3de998.png)

It’s currently writing to the wrong column but am making progress… How does one set a visibility to be active?

---

<div class="post-metadata">

**Author:** ![Dan76](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dan76/32/15696_2.png) [@Dan76](https://community.glideapps.com/u/Dan76)\
**Post date:** [March 4, 2021, 2:17pm UTC](https://community.glideapps.com/t/increment-only-if-after-set-time/23760/4 "2021-03-04T14:17:16Z")

</div>

Managed to get it to update a column with the time for every increment added. Have then played around with the visibility settings but can’t see how to set it to now +15? There is only ‘now’.

---

<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:** [March 4, 2021, 2:28pm UTC](https://community.glideapps.com/t/increment-only-if-after-set-time/23760/5 "2021-03-04T14:28:57Z")

</div>

You should be able to have a math column with the formula T + 15/86400. The T part points to the column where you write the timestamp.

So for every increment, update the timestamp, disable the increment as long as the math column time is after now.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 4, 2021, 2:46pm UTC](https://community.glideapps.com/t/increment-only-if-after-set-time/23760/6 "2021-03-04T14:46:46Z")

</div>

Just extending on what @ThinhDinh said, rather than using visibility settings, I would disable the increment as part of the custom action logic. So your custom action configuration might look something like this:

 ![Screen Shot 2021-03-04 at 10.42.25 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/a/fabbe7c95d55fbb3866ffdad5096b8643c18b44c.png)

- `IncrementAllowedAt` is the math column that Thinh referred to - which is the last lap time + 15 seconds
- If that time is “after now” (ie. in the future), then just show a notification
- Otherwise, increment the lap counter and reset the lap timestamp

I’ve tested this, and it works quite well.

---

<div class="post-metadata">

**Author:** ![Dan76](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dan76/32/15696_2.png) [@Dan76](https://community.glideapps.com/u/Dan76)\
**Post date:** [March 4, 2021, 11:52pm UTC](https://community.glideapps.com/t/increment-only-if-after-set-time/23760/7 "2021-03-04T23:52:57Z")

</div>

Have set it up and it works perfectly. Was worried there might be lag but it’s instant. I could have tinkered for decades and not figured this out, didn’t know the maths column existed.

A huge thank you.

Dan

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:53pm UTC](https://community.glideapps.com/t/increment-only-if-after-set-time/23760/8 "2024-01-17T16:53:06Z")

</div>


