Skip to content

Delete Files by Age

This Step is helpful when you need to delete files in your OneReach.ai account whose last modified versions are older than a specified period, e.g., 30 days. You define the folder, the file’s status, and the period. When the Flow reaches the Step, it calculates the cut-off date/time and deletes all files with the selected status that were last modified before the calculated date/time. To delete the files in another OneReach.ai account, use Cross-account settings.

Prerequisites

To access another OneReach.ai account, make sure you meet the following requirements:

  • Your account has the Super Admin role
  • Your Flow has the Super Admin Flow permission level
  • You have an Account ID or User/Flow Authentication token related to the OneReach.ai account you want to access

File settings

To set up this section, make sure to:

  1. Provide the folder from which to delete files
  2. Select the file status of the files that will be deleted
  3. Define the Delete files older than value

Folder

To delete the files from the folder within Files of your OneReach.ai account, click the Select folder, then choose the folder in the popup window.

Alternatively, the folder can be defined in the folder field in the foldername/ format. Use / as the divider.

TIP

Enter the / character to delete the files from the root folder. To delete files in a folder of another Onereach.ai account, we advise providing the path using foldername/ format.

File status

By default, all files from the selected folder will be deleted. Options to delete only private or public files are available.

Delete files older than

The Delete files older than value is the period that will be subtracted from the date/time when the Flow reaches the Step. All files whose last modified version is older than the Calculated date/time value will be deleted. The default value equals 30 days. For example, acceptable time formats are 5d, 23h, 33m, or 126h.

TIP

Setting the Delete files older than value as 0s will delete all files with the selected file status in the selected file folder.

Conflict handling

If the defined path doesn’t exist by default, the Flow will proceed down the "not found" exit. Select the "next" or "error" option in the dropdown to take the Flow down the respective exit.

TIP

The "not found" exit is removed from the Flow tree if a different exit is selected.

Cross-account settings

By default, you can upload a file only to your OneReach.ai account. To upload a file to a different OneReach.ai account, do the following:

  1. Make sure that your OneReach.ai account has the Super Admin role. To check your role, go to Action desk -> Users. The role is defined under the user name. If your role isn't Super Admin, contact OneReach.ai support to change it.
  2. Go to the General tab of the Flow, then open Deployment settings -> Flow permissions level and select Super Admin.
  3. Turn on the Use custom authentication token toggle.
  4. Choose one of the access types and provide respective data:
  • For the Authentication token type, select the USER or FLOW type and provide the respective token. Reach out to OneReach.ai support to obtain the value for this token.
  • For the Account ID type, provide the Account ID of the user you wish to access. The Account ID value is a unique UUID v4 format string value generated for each OneReach.ai account. You can find the option to Copy the account ID in the Profile settings of the OneReach.ai window under the Current account label.
  1. Save and activate the Flow.

Merge field settings

The Step returns the result as a JSON object and stores it in the Merge field. To learn more about Merge fields, their types, and how to work with them, follow this link.

See below an example of the Merge field object’s structure:

JSON
{
  "deleted": 1
}
{
  "deleted": 1
}

Error handling

By default, the Step handles errors using a separate exit. If an error occurs during the Step execution, the Flow proceeds down the error exit, e.g., the cut-off period value is invalid. For more information on error handling, follow this link.

Reporting

The Step automatically generates Reporting events during its execution, allowing for real-time tracking and analysis of its performance and user interactions. To learn more about Reporting events, follow this link.