I have a requirement for an app where I need to delete records that are 30 days or older. Has anyone found a good solution for this? Currently this app is creating around 20 records per day, in the future this will get up to around 50 records.
Hi @Todd-DMG_MORI,
There are approaches you could take to delete these records both in a Tulip application or some script running on a middleware. I’ll describe at a high level the approaches I would take:
If you want to build this in a Tulip app, use Table Queries and Aggregations to filter this data. Write a query to filter for only records created before a certain date (and any other parameters that may be relevant), which you can pass dynamically. Then, using a unique value aggregation on the ID field, the result of this implementation will leave you with an array of record IDs that match the criteria you are using to drive the deletion.
Once you have the records to be deleted, you can use the looper widget within the Tulip Library to delete these records one by one, or you can use step triggers as well to drive a looping operation. Unfortunately, we don’t have a batch delete API endpoint for filtered records at this time, but we’re certainly evaluating this possibility!
If you were running this on the middleware, you could use Tulip’s Table API endpoint to run a GET request with similar filter parameters to pull a list of record IDs, store those to an array, and then loop through the array calling the DELETE record endpoint for each individual ID.
Let me know if this helps!