DirectoryExists

Estimated reading: 3 minutes 1904 views

This activity allows the user to check and validate whether the specified directory exists on the connected SFTP server. It must be used within a scope activity.

Properties

INPUT

DirectoryPath: *This parameter indicates to specify the directory path to validate whether it exists in the connected SFTP server. 

It accepts input values in “String” datatype. You can either hardcode the values in “String” format or provide the value in String” datatype.

MISC

DisplayName: Displays the name of the activity. The activity name can be customized, which aids in troubleshooting.

SkipOnError: Specify the “Boolean” value as “True” or “False.”

True: Continue executing the workflow regardless of any errors thrown.
False: Halt the workflow if it encounters any errors.
None: If the option is left blank, the activity will, by default, behave as if “False” were chosen.

Version: It indicates the version of the feature being used.

OUTPUT

Result: It provides the ability to view the execution status of the activity. It returns values in “Boolean.”
True: Indicates that the activity has been executed successfully without any errors.
False: Indicates that the activity has been unsuccessful due to an unexpected error being thrown.

Represents mandatory fields to execute the workflow


Here’s an example of how the activity is used in the workflow:

In the following example, we check if the specified directory exists on the SFTP server. I have used our SFTP server for this demonstration, but you can automate it with your own SFTP server.

1. Create a solution as “Backup”.
2. Install the “SFTP” feature from the “Manage Features” option.
3. Drag and drop the “SFTP Scope” activity into the workflow and set it as the start node.
a. This activity will authenticate the provided credentials and establish a connection to the SFTP server.
b. Enter the SFTP credentials, including the “Host Name,” “User Name,” and “Password,” in their respective fields.
4. Add the “DirectoryExists” into the body of the “Sftp Scope” activity.
a. Provide the “DirectoryPath” in the property.
b. In this case, I am providing the directory path from my SFTP server to validate it, which is “/SampleTest/”.
5. Now, navigate to the “Result” in the output section of the property to declare a variable to view the output.
6. Add the “Writelog” activity to print the output.
a. Enter the “InputString” as “DE.ToString” and provide the log level as “Info”.
7. Save and execute the workflow.

The bot will execute the workflow and provide the result of the output either as “True” or “False”.

Share this Doc

DirectoryExists

Or copy link

CONTENTS