Exists

Summary

Use the Exists function to determine whether a file or directory exists on Connect’s SFTP server file system.

Syntax

Exists([FilePath=<path to file>] [, Directory=<directory>])

Parameters

Parameter Description
FilePath (Optional) String value or expression used to check the existence of a specific file. Contains the full Unix-style path name and file name. If no path is given, the root SFTP directory is assumed.
Directory (Optional) String value or expression when checking the existence of a directory name or directory path. Format is Unix-style.

Return Type

Boolean

Details

Connect is integrated with Xactly’s SFTP server, connectftp.xactlycorp.com. Connect’s file commands can read and write files and manipulate directory structures located on the SFTP file system. An SFTP account is not required to use these functions. However, one is required to access the file system via SFTP clients. Contact Xactly Customer Support to setup an SFTP account if your business does not already have one.

The function returns true if the file specified by the FilePath parameter or the directory specified by the the Directory parameter exists.

If either the Filter or Regex parameter is specified, the Directory parameter is scanned for files matching the pattern, returning true when a match is found.

Examples

call Exists(FilePath='/tmp/foo.csv');

false

call Exists(Directory='/tmp');

true

alter pipeline p_upload_closed_opportunities 
add step s_check_for_file
as (Condition=(Exists(FilePath=:v_some_file_path)),
Retries=0,
RetryInterval=0,
OnConditionFalse=s_send_file_not_found_email,
AbortOnConditionFalse=true);

Related Commands

DirList