Listing Files in a File System

Last Updated: 07/20/2016 Introduced in Verision: 2.0

The List Files in Directory component creates a list of filenames for a given directory.

Create a flow to list the files in the Flow Designer. In the Toolbox panel, under the category Integration > File,drag a List Files in Directory component to the workspace.

Example

Our example flow will display a form that lists the files in our the directory C:\Program Files\Decisions\Decisions Services Manager.
result
 
 
 
The form, List Files, was created for this example. It simply contains a Simple List component, configured to display string data as follows:
 formPreview
 
 

Our first step will be to get the list the files in the directory.

In the Flow Designer’s start-up window, under the category Integrations > All Integrations > File, select a List Files in Directory component and click Add to add it to the workspace.
flowStarts
 
Our next step is to add the form. Drag and drop the List Files form, found in the Toolbox panel, under the category Forms [Interaction] > Current Folder.
 
Connect the steps as follows:
connectSteps
 
 
With components placed and outcomes connected, next is to configure the steps.
 
Click on the List Files in Directory 1 step. From its Actions menu, select Show Mapping Editor to open the Mapping Editor.
 showMappingForList
 

List Files in Directory 1 accepts only one input – directoryName. Since we know the name of the directory to use, give directoryName a mapping type of Constant and a value of “C:\Program Files\Decisions\Decisions Services Manager”

defineDirectoryMapping

 
 
This completes the mapping for the List Files in Directory step, so click OK to save the changes and close the Mapping Editor.
Next, configure the List Files form by selecting it and clicking the link Show Mapping Editor.

List Files form has only one input – FilesFromDirectory – which is mapped from ListFilesInDirectory1_Output. Click OK to close the Mapping Editor. Save and close the flow.

 
mappingToForm 
Click the Debug Flow link. A form containing a list of all of the files inside the folder C:\Program Files\Decisions\ Services Manager, including sub-folders, displays.

Note that in Decisions version 3.5 and above, you’ll need to click on Test Flow to access the Debugger.

3.5 Test Flow Shot

 

result
 
 

Additional Resources