Skip to content

Delete Files by Age (Files) v1.0.0 Help

Deletes files from a folder in the Files service whose last modification date/time is older than the specified period.

How can I use this Step?

This Step is useful when you need to delete files in your OneReach.ai account whose last modified versions are older than a specified period of time, e.g. 30 days. You define the folder, file's status and the time period. When the Step is reached in the Flow, it calculates the cut-off date/time and deletes all files with the selected status that were last modified prior to 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 or Flow authentication token related to the OneReach.ai account you want to access.

File settings

To set up this section, take the following steps:

  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 button, 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.

Note: Enter just the / character to delete the files from the root folder.

Note: To delete files in a folder of another Onereach.ai account it is advised to provide 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 time period that will be subtracted from the date/time when the Step is reached in the Flow. All files whose last modified version is older than the calculated date/time value will be deleted. The default value equals 30 days, examples of acceptable time formats: 5d 23h 33m or 126h.

Note: 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

By default, in case the defined path doesn't exist, 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.

Note: the not found exit is removed from the Flow tree if a different exit is selected.

Cross account settings

By default, a user can delete files only from their own OneReach.ai account. To delete files from a different OneReach.ai account, please do the following:

  1. Make sure that your OneReach.ai account has the Super Admin role. To check your role, go to the Action desk -> Users. The role is defined under the name of the user. If the role isn't Super Admin, reach out to 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. Please, 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. An option to Copy account ID can be found in the Profile settings of the OneReach.ai window under the Current account label.
  1. Save and activate the Flow.

Merge field settings

The output data of the Step will be stored under the name provided in the merge field name. It includes the deleted property that shows the number of files that were deleted.

See below an example of the merge field object's structure:

json
{
  "deleted": 1
}
{
  "deleted": 1
}

Error handling

Handle error is on by default and adds an error exit to the Step. The Flow will proceed down this exit if any error was encountered during the execution of the Step, e.g. the cut-off period value is invalid.

Reporting

Step event is reported once the Flow exits the Step. It collects the data which can be used further in reports. You can specify tags to organize the collected data.

Services dependencies

  • bot Deployer v2.7.1
  • library v2.9.0
  • sdk API v2.7.0
  • studio v2.49.0

Release notes

v1.0.0

  • Initial release