I’m making an application where the user has daily activities, they can be completed or not, I want that at midnight, all completed activities in the database change to not completed. How do I do that?
My app:
I’m making an application where the user has daily activities, they can be completed or not, I want that at midnight, all completed activities in the database change to not completed. How do I do that?
My app:
Run a workflow, at midnight, which changes all completed activities in the database to not completed.
you mean a backend workflow right?
Of course… specifically, an API Workflow (or maybe a Recurring Event).
does +1 day represent the next day or +24 hours?
Neither…
+1 days
increments the Date by 1 day (which most of the time means it adds 24 hours, but that’s not always the case).
But I’m not sure what your screenshot has to do with your question, nor my answer…
You’re searching for Exercises which have been modified after tomorrow - which is impossible, so will always return no results.
In any case, as I previously mentioned, you can’t do this on a page workflow, you need to schedule an API workflow to run at the given time, and make the changes there.
If you don’t know how to do that, I’d suggest you start with reading the Bubble manual to learn the basics.
So basically, every activity in your database will be reseted to Completed = NO
.
Completed = YES
.Current Date/Time +24 hours :rounded down to date
Now, create a button somewhere in your app to start this backend workflow by scheduling it to Current Date/Time + 24 hours :round down to date
. Once you start it, it will keep rescheduling itselft forever…
For WU reasons, how i usually approach this ‘resetting’ is to actually skip the reset all together and use frontend formatting.
I would change the ‘Checked’ field to a date instead of a yes/no.
The conditional 'This Exercise’s checked > Current date time rounded down to day" can substitute the yes/no field, and it will skip the need to spend 1000s of WUs on resetting all exercises every day, and it applies with no delay, at midnight on the dot, on all exercises.
This cant be applied to all use-cases, but in this simple scenario it works quite well.
Excellent tip!
This is a much smarter solution than what I was trying to do, thank you for helping me.
This topic was automatically closed after 70 days. New replies are no longer allowed.