I’m creating a do to list/ daily routine checklist. Sense some of the to do list items will be checked off everyday id like to set it up so that when they are marked complete they automatically reset and are available to check off again the next day. I’m thinking maybe have them repopulate every night at midnight. Does anyone know how to do this?
I’m currently using repeating groups to create the checklist to give some context. I’m also open to other ways of creating a checklist if thats whats needed.
Hello! Great question. Here are the step’s I’d take:
Make sure your task data type has fields for name (text), and complete? (yes/no), and daily? (yes/no).
Set up an API workflow in the backend workflows section of your app called “reset-daily-task”
Give that workflow a parameter that accepts a single task record (not a list)
Give that workflow an action that makes changes to the task parameter, and updates the “complete?” field to “no.”
Back on the front end page, set up a workflow event on the checkbox inside of your repeating group that says “when checkbox's value is changed -> only when this checkbox is checked and current cell's task's daily task? is yes”
That workflow should have an action that makes changes to the current cell’s task, and updates the complete? field to yes.
The same workflow should then have an action to "Schedule an API workflow (reset-daily-task).
On this “Schedule an API workflow” action, make sure to set the “schedule date” to “current date/time (+days) 1:rounded down to date,” which should make the scheduled time the next instance of midnight.
The above steps will ensure that anytime a task is marked complete, if that task is a “daily task” according to the field in the DB, it will automatically be reset to not complete at midnight.
I hope this helps! There are a lot of different shapes a feature like this could take, and this is just one option.