# Button Cooldown

**URL:** <https://community.glideapps.com/t/button-cooldown/42632>\
**Category:** Ask for Help\
**Created:** [June 1, 2022, 10:47pm UTC](https://community.glideapps.com/t/button-cooldown/42632 "2022-06-01T22:47:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gappled](https://avatars.discourse-cdn.com/v4/letter/g/c6cbf5/32.png) [@Gappled](https://community.glideapps.com/u/Gappled)\
**Post date:** [June 1, 2022, 10:47pm UTC](https://community.glideapps.com/t/button-cooldown/42632/1 "2022-06-01T22:47:43Z")

</div>

I’ve coded a button so that **when pressed, it increments a number within the spreadsheet by 1.** This is fine, however, **is there a way to add a 24 hour cooldown to it?** Therefore, **users can only press the button once every 24 hours. If they attempt to do it more than once within the 24 hours, then it will show the failed notification and will not increment the number by 1.**

Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![justinjmp](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/justinjmp/32/43205_2.png) [@justinjmp](https://community.glideapps.com/u/justinjmp)\
**Post date:** [June 1, 2022, 11:03pm UTC](https://community.glideapps.com/t/button-cooldown/42632/2 "2022-06-01T23:03:20Z")

</div>

Could you add an action to record the time that it was pressed to a column, add another column to have the current time, and then an if statement to see if it is within 24 hours? If yes, do not display the button, if no, display the button?

I have similar logic in my daily tasks template that you could use as a base: [Daily Goals Tracker Template • Glide](https://www.glideapps.com/templates/daily-goals-tracker-y9)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/0/d0132f10d9a87771f10dd7a5a7a986ea5235ec4f.jpeg)

I believe I have it by day and not within 24 hours but you could adjust it as needed.

Happy Building!  
Justin

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [June 2, 2022, 12:47am UTC](https://community.glideapps.com/t/button-cooldown/42632/3 "2022-06-02T00:47:01Z")

</div>

Exactly.

1. Button push has a set column of current date and time.
2. Math column to add 1 to the date.
3. If then else column to check if Math column is after \> now
4. If is after now, show notification that they must wait, else allow button

---

<div class="post-metadata">

**Author:** ![Gappled](https://avatars.discourse-cdn.com/v4/letter/g/c6cbf5/32.png) [@Gappled](https://community.glideapps.com/u/Gappled)\
**Post date:** [June 3, 2022, 11:47am UTC](https://community.glideapps.com/t/button-cooldown/42632/4 "2022-06-03T11:47:49Z")

</div>

Thanks very much both of you! I really appreciate the help.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [June 4, 2022, 11:48am UTC](https://community.glideapps.com/t/button-cooldown/42632/5 "2022-06-04T11:48:09Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
