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.
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.
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.
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.))
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.
To enter exclusions, click the Advanced tab and enter the properties as follows:
In the Exclude mask box, enter the names of any files within the specified file-name parameter that you want to exclude from the check. You can use asterisk (*) and question mark (?) as wildcard characters. Separate multiple entries with a pipe symbol (|).
To exclude files from the check based on date, select Only if newer than or Only if older than. Then use the date and time boxes to select the desired date and time. You can also click the Custom button and select a limiter such as Last 24 hours, or you can select Expression and enter the date and time as an expression.
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.
To set the Description tab properties, refer to Description Tab Options.
To set the Error Causes and On Error tab properties, refer to Step Error Handling.
When finished, click OK to save settings and close the properties dialog window.
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.
Click the Format button .
Adding Task Steps
If File Exists Action
End If Action-Properties