Listing Files in a File System
- Updated on 09 May 2013
- 1 minute to read
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.
Our example flow will display a form that lists the files in our the directory C:\Program Files\Decisions\Decisions Services Manager .
The form,List Files, was created for this example. It simply contains a List Box component that is configured to display a string datatype.
Our first step will be to get a list of the files in the directory.
In the Flow Designer's startup window, under Integrations > All Integrations > File , select the List Files in Directory component and click Add to add it to the workspace.
Our next step is to add a form. Add the List Files form to the Flow Designer. This form can be found in the Toolbox panel, under the category Forms [Interaction] > Current Folder .
Connect the steps.
Since the components are placed and the outcomes are connected, the next course of action is to configure the flow steps. Double click on the List Files in Directory step. From the Actions Toolbar select Edit Input Mappings to open the Mapping Editor.
List Files in Directory 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 .
This completes the mapping for the List Files in Directory step. Click OK to save the changes and close the Mapping Editor .
Configure the List Files form by selecting it and clicking the link Edit Input Mappings .
List Files form has only one input - FilesFromDirectory - which is mapped from ListFilesInDirectory_Output . Click OK to close the Mapping Editor. Save and close the flow.
Click the Debug Flow link. A form containing a list of all of the files inside the folder C:\Program Files\Decisions\ Services Manager displays.