List Files in Folder (Files) v1.0.0 Help
Lists the details of the files stored in the selected folder in the Files service.
How can I use this Step?
This Step is useful for retrieving file data (e.g. name, size, creation and modification time, link etc.) of every public and private file in the defined folder of the Files service in your OneReach.ai account. You choose the folder to list the files from and whether to include their URLs in the output. When this Step is reached during execution, it lists all the found data in its output, and the Flow proceeds down the next exit. An option to select the Flow behavior in case the defined path doesn't exist is available. To list 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:
- Provide the folder from which to retrieve the list of files.
- Optionally, turn on the toggle to return download URLs of each file in the output of the Step.
File folder
To retrieve 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 list all files stored in the Files service.
Note: To list files in a folder of another Onereach.ai account it is advised to provide the path using the
foldername/
format.
Return download URLs
By default, the Step will not add the download URLs of the listed files to its output. In case this data is needed further in the Flow, turn on the respective toggle.
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 list files only from their own OneReach.ai account. To list the files from a different OneReach.ai account, please do the following:
- 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.
- Go to the General tab of the Flow, then open Deployment settings -> Flow permissions level and select Super Admin.
- Turn on the use custom authentication token toggle.
- 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.
- 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 is expected as an object containing two arrays of public
and private
files data, each consisting of the following properties:
Key | Type | Description |
---|---|---|
public | array | An array of objects, each includes data about a public file in the selected folder. |
private | array | An array of objects, each includes data about a private file in the selected folder. |
key | string | The file path to the respective file. |
size | number | The size of the respective file in bytes . |
url | string | The link to respective the file in Files. |
contentType | string | The file type and extension in type/extension format. |
createdAt | number | The respective file's time of creation in timestamp format. |
updatedAt | number | The respective file's time of the last modification in timestamp format. |
ttl | number | The auto-delete date of the uploaded file in timestamp format. |
parentFolder | string | The folder name of the folder to which the respective file belongs. |
lastModified | number | The respective file's time of the last modification in timestamp format. Present to support backward compatibility. |
See below an example of the merge field object's structure:
{
"public": [{
"key": "Test/valid.json",
"isPublic": true,
"size": 9,
"contentType": "application/json",
"parentFolder": "Test/",
"createdAt": 1680181089061,
"updatedAt": 1680181089061,
"autoDelete": null,
"lastModified": 1680181089061,
"url": "https://files.staging.api.onereach.ai/public/aff9af17-f0b5-4383-a7d7-5832a53216ea/Test/json.json"
}],
"private": [{
"key": "Test/invalid.json",
"isPublic": false,
"size": 5,
"contentType": "application/json",
"parentFolder": "Test/",
"createdAt": 1680601474772,
"updatedAt": 1680601474772,
"ttl": 1684581090739,
"lastModified": 1680601474772,
"url": "https://files.staging.api.onereach.ai/abb9af17-f0b5-4383-a7d7-5832a54896ea/Test/test.json?Expires=1682075528&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9maWxlcy5zdGFnaW5nLmFwaS5vbmVyZWFjaC5haS9hYmI5YWYxNy1mMGI1LTQzODMtYTdkiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY4MjA3NTU8VavCP6qU4Z5W5ZjqvI1-NHiqMpuk6o7xXivnqWkUQ5OkbWA4ZyOcP02iwAhlTD-2Ti86nS~QQEfrFpKPnYBNpRNu~nhK7fioxgem97tRaMrm3eoVigh2OzK4oJs~epUB3btB1gPKw8tTjSUD03PeUXjQBBbE6t2fMA7-puJpHA7A5DNDzI6mTmppaosPnYBcCrDO-AuCRmg6C8xRA6i5yBezPyCkwK4AIMsc1CId6n9MzNRDb23wjahV0T3rDnpOugcc4cgJ9e3kYAqrcik8g4NCdCnuRSZQiVNk9GAeyEg__&Key-Pair-Id=K33HFYYO5LG4DE"
}]
}
{
"public": [{
"key": "Test/valid.json",
"isPublic": true,
"size": 9,
"contentType": "application/json",
"parentFolder": "Test/",
"createdAt": 1680181089061,
"updatedAt": 1680181089061,
"autoDelete": null,
"lastModified": 1680181089061,
"url": "https://files.staging.api.onereach.ai/public/aff9af17-f0b5-4383-a7d7-5832a53216ea/Test/json.json"
}],
"private": [{
"key": "Test/invalid.json",
"isPublic": false,
"size": 5,
"contentType": "application/json",
"parentFolder": "Test/",
"createdAt": 1680601474772,
"updatedAt": 1680601474772,
"ttl": 1684581090739,
"lastModified": 1680601474772,
"url": "https://files.staging.api.onereach.ai/abb9af17-f0b5-4383-a7d7-5832a54896ea/Test/test.json?Expires=1682075528&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9maWxlcy5zdGFnaW5nLmFwaS5vbmVyZWFjaC5haS9hYmI5YWYxNy1mMGI1LTQzODMtYTdkiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY4MjA3NTU8VavCP6qU4Z5W5ZjqvI1-NHiqMpuk6o7xXivnqWkUQ5OkbWA4ZyOcP02iwAhlTD-2Ti86nS~QQEfrFpKPnYBNpRNu~nhK7fioxgem97tRaMrm3eoVigh2OzK4oJs~epUB3btB1gPKw8tTjSUD03PeUXjQBBbE6t2fMA7-puJpHA7A5DNDzI6mTmppaosPnYBcCrDO-AuCRmg6C8xRA6i5yBezPyCkwK4AIMsc1CId6n9MzNRDb23wjahV0T3rDnpOugcc4cgJ9e3kYAqrcik8g4NCdCnuRSZQiVNk9GAeyEg__&Key-Pair-Id=K33HFYYO5LG4DE"
}]
}
In case the defined path doesn't exist, the merge field value depends on the exit:
- next
{
"public": [],
"private": []
}
{
"public": [],
"private": []
}
- not found -
null
Error handling
The handle error toggle is enabled by default and adds an error exit to the Step. The Flow proceeds down this exit if any error is encountered during the Step execution, e.g. in case the Files service is unavailable.
If the handle error toggle is disabled, the Step does not handle errors. In this case, if any error occurs during the Step execution, the Flow fails immediately after exceeding the Flow timeout. To prevent the Flow from being suspended and continue handling errors, you can place the Handle Flow Error Step before the main logic or your Flow.
Reporting
After the Step completes, it generates a report that includes its execution status and other details. You can customize the report by adjusting the Step's log level and adding tags.
Log level
By default, the Step's log level matches that of the Flow. You can change the Step's log level by selecting an appropriate option from the Log level dropdown.
Tags
Tags provide a way to classify and search for sessions based on their attributes. To create a new tag, specify its category, label, and value. You can then use tags to filter and group the sessions in the report.
Services dependencies
- flow builder v2.10.0
- event-manager v2.0.1
- deployer 2.2.0
Release notes
v1.0.9
- Changed the Step name from Get Files List (Files) to List Files in Folder (Files)
- Changed the data type for
lastMofified
property fromISO 8601
totimestamp
- Updated Files SDK
- Removed return of folders in the output of the Step.
v1.0.0
- Initial release