Suppose you must automatically delete entries from your system after a certain period due to specific cybersecurity regulations. In that case, you can consider adding a script to your database to help you automatically delete records that are over x days old on a specified sheet. For example, if you want to delete records that are 28 or more days old automatically, please follow the steps below:
db.deleteOldRecords("/tabname/1",28);
Be sure to save your changes before exiting. If you want to change the number of days in the setting, modify the number after "db.deleteOldRecords('/tabname/1')". For example, if you want a record deleted if it is 20 or more days old, you should enter:
db.deleteOldRecords("/tabname/1",20);Please note: 1. This workflow is only for deleted records from a single sheet. It does not delete records from the entire database. 2. To ensure the record is indeed deleted, the script will permanently remove the record. It will not be moved to the Recycle Bin, which means it cannot be recovered. Please make sure you absolutely need this feature before writing the related script.