Extract all files' names in a directory and stores them in an array. The 'Save value to variable' activity appears automatically when choosing the 'List directory files' activity. It automatically saves the value to a variable. However, the activity is not mandatory to use and can be removed from the workflow.
Set a value: enables you to directly write the desired folder path to exctract files names from.
Save the previous step result: chooses the previous activity result as a path.
Calculate a value: enables you to use available properties and methods to form a path.
Contains an annotation to the activity. The input text will be displayed above the activity name.
The list of files and folders is stored in the
directory_files variable by default. This variable represents an array of strings. For example, if in the specified folder there are folders "documents", "reports" and files "scan.png", "employees.xlsx", "agreement.docx" then the output array of string will be the following:
["agreement.docx", "documents", "employees.xlsx", "reports", "scan.png"].
This activity is useful when you need to perform similar actions with a huge amount of files. In this case you can get all files' names in a folder and then run a loop.