Is it possible to search through a database and remove N database entries where their Created Date is N days/seconds/etc. ago?
Thank you!
Is it possible to search through a database and remove N database entries where their Created Date is N days/seconds/etc. ago?
Thank you!
Hi @nchoi Yes, this is definitely possible. You can use the Delete a List of Things action, and use something along the lines of:
This action would delete all of the Events that started more than a week ago, since they began before the (Current Date Time - 7 days) date.
Would there be a similar way to automate things ?
For instance, run a routine that deletes all 1 month old “offers of things” at least once every day.
…without clicking a button every day !
@ericterii You can! On paid plans, you can use “recurring workflows”:
With the example of deleting a list of things, you would first create a recurring event in the API section:
Recurring events need a ‘type of thing’ associated with it. Since this is more of a single ‘admin’ action, I’ve used “User”, so this is triggered by the admin Current User once they click a “Start” button. (I think you may need to change this to something other than Current User if you have multiple admin recurring event workflows, but I’m not 100% sure):
Add the delete a list of things action:
Then you’ll need to schedule and set the frequency of the recurring event one time. On your admin page (for example), there could be a button which starts this:
This example is in a Hobby App, but you can set a single monthly recurring event under the Personal Plan. If you later decide to cancel the recurring event, a separate button workflow will accomplish this by setting the frequency to “None”:
And here’s more info on recurring events:
That should do it!
Perfect faye, thanks for the links !
No problem at all!