GetFiles

The GetFiles component retrieves the names of all the subdirectories and files in a specified directory.

Screenshot

Ports

The GetFiles component exposes the Control In, Control Out, Data In, and Data Out ports by default.

Port Description
ControlIn Must be connected to the Control Out port of one or more components.
ControlOut Can be connected to the Control In port of another component or the default end component.
Data In The GetFiles component exposes the following Data In ports by default:
directoryPath: specifies the path of the directory whose subdirectories and files are to be retrieved(string).
searchSubDirectories: specifies if Intellibot must search the subdirectories of the specified directory (Boolean). The default Boolean value is “True”. If you do not want the subdirectories searched, you can change the value to “False”.
fileExtension: specifies the file extension to retrieve (string). This is an optional port. If you do not specify the file extension, all files types in the specified directory are retrieved.
Data Out Returns the names of all the subdirectories and files in the specified directory (ReadOnlyCollection’1).

Properties

To edit the properties of the GetFiles component, in the Properties window, change the required property. You can edit the following properties.

Property Description
Search Search for the respective property.
Delay After Execution Specifies the wait time (in seconds) after the action is performed.
Delay Before Execution Specifies the wait time (in seconds) before the action is performed.

Example

Let us consider an example.

Screenshot

To retrieve the path to a system special folder:

  1. In the Toolbox, expand Utilities and then expand Directory.
  2. Drag the GetFiles component and drop it on the Design surface.
  3. Double-click the directoryPath box and enter the path of the required directory.
  4. To override the existing data source, right-click the directoryPath box.
  5. Click Override and change the data source.

    Note

    To learn more about overriding the data source of the data port, refer the Override section.

  6. To override the default Boolean value of the searchSubDirectories Data In port, if required:

    • Right-click the searchSubDirectories box.
    • Click Override.
      The PORT PROPERTIES dialog box is displayed.
    • In Read Data From, select Static.

    Note

    In Read Data From, you can select Connection or Variable instead of Static. To learn more about the Connection or Variable data source override options, refer the Override section.

    • In Static Value, click the drop-down arrow and select True.
    • Click OK.
      The Design surface displays the process flow.
  7. Double-click the fileExtension box and enter the file extension.

  8. To override the existing data source, right-click the fileExtension box
  9. Click Override and change the data source.

    Note

    To learn more about overriding the data source of the data port, refer the Override section.

  10. Add the For Each component to retrieve the Sub Folders in an order.

  11. In the Toolbox, expand Loops.
  12. Drag the For Each component and drop it on the Design surface.
  13. In the Toolbox, expand General.
  14. Drag the Show component and drop it on the Design surface
  15. Connect all the control ports in the activity.
  16. In the toolbox, click Run. The names of all the subdirectories and files in the specified directory are retrieved.