Toggle button for ingredient data checking

Hi Community,

Just new here on Grist. I was wondering how to get the toggle button to automatic turn off after X amount of days after it has been turned on.

I want to build this because we have an industrial kitchen, and the ingredient pricing needs to be checked every 120 days. So that the user can see which ingredients need a price check.

When price is checked (and updated or not), they can turn the toggle back on and the counter starts ticking again.

We cannot use the last updated column and filter on that one, because ingredient price checks won’t require an update on the row if the price hasn’t changed.

Hopefully this is doable in Grist. Thanks in advance for the help!

Greetings from The Netherlands, Robbie

Hi @Robbie_van_Heeswijk,

You can use functions like NOW() and DAYS() to test how long ago the toggle was turned on.

To do this, you need two things:

  1. A trigger formula that will update itself whenever the toggle is turned on, just a simple formula like NOW() if $Toggle else value that is triggered on every Toggle column change.
  2. A formula column that checks how long ago the toggle was set, with a formula like: DAYS($Last_on, NOW()) > 120

Now you will be able to filter those records based on this column. Formula columns with NOW() or TODAY() are recalculated every hour automatically, so there is no need to update records by hand.

Unfortunately, there is no way to turn off the toggle column automatically. You can use conditional formatting for some indication to guide the user that he needs to toggle this checkbox manually after the check is done.