If File Exists Action—Setting Properties

The If File Exists action is used to set up conditional steps that will be performed only if a specified file is in a specified condition.  

When you create an If File Exists step, an End If step is created automatically. Place the steps to be preformed if the condition is met between the If File Exists step and the End If step. Steps within the block should be indented for visual clarity.

To set If File Exists properties

  1. From the Task Builder Available Actions pane, open the Flow folder and double-click the If File Exists action or drag it into the Steps pane.

  2. In the If box, select the type of check to be performed. The options are: File exists, File does not exist, File is accessible, File is not accessible.  

  3. In the File box, click the Open Folder button and navigate to the location for the file. If the file does not currently exist, you can select any file in the target folder and click Open. Then replace the file name with the desired entry. You can use wildcard character asterisk (*) and question mark (?). For example, use *.txt to specify any text file. (You can set exclusions and file attributes in the Advance tab and the Attributes tab. See below.))

  4. To populate a dataset with the file data, enter a name for the dataset in the Create and populate dataset with result information box. (Dataset names must be alphanumeric, begin with a letter, and contain no spaces.)

    The dataset will show the file's name, size, date created, date modified, date last accessed, plus the state of various attributes.

  5. To enter exclusions, click the Advanced tab and enter the properties as follows:

  6. To have file attributes considered in the file check, click the Attributes tab and then select On or Off for any attributes that you want used as criteria. The default is Doesn't matter, which means the attribute will be ignored. The attributes to select from are: Read-only, Archive, System, Hidden, and Compression.

  7. To set the Description tab properties, refer to Description Tab Options.

  8. To set the Error Causes and On Error tab properties, refer to Step Error Handling.

  9. When finished, click OK to save settings and close the properties dialog window.

To auto-indent after all steps are added

  1. In the Task Builder Steps pane, hold down SHIFT and click the first and last steps in the block so that the complete block of steps is selected.

  2. Click the Format button .

See Also

About Actions

Adding Task Steps

If File Exists Action

End If Action-Properties