How to do something on a specific date or time?
I'm wondering if it is possible to do something on a specific date or time. For instance, I have a taskboard in my app where I can set a due date. I would like to add to a table if the date is either near, on date or past date.
I was looking at scheduled functions, but I couldn't figure out if that could lookup a value in the database and then do the function?
2 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
You could schedule a function to run when you add to the table. You can pass the task id to the function. When it runs it can read from the tasks table and do something, then mark the task as done. You can store the scheduled function id in the table so if you want to reschedule it you can cancel the old scheduled function and schedule a new one