The "Exist" activity is employed to determine whether a specific file or directory exists in the
designated path. We can also assess the existence status of a file or directory within a shared
folder, granted we have access to it.
Technical Reference
|
INPUT |
Mode: Select from the dropdown the option for which you want to check the existence status. |
Path: This field represents the path where the specified file or directory is located.
You have the option to either hardcode the values in the "String” variable or pass the values as “String” datatype. This accepts only the “String” datatype. |
||
MISC |
Display Name: Displays the name of the activity. The activity name can also be customized which will help in troubleshooting. |
|
SkipOnError: Specify the Boolean value as “True or False.” |
||
Version: It specifies the version of the FS automation feature in use. |
||
OUTPUT |
Result: It helps to view the execution state of the activity. It returns the values in Boolean format. |
* Represents mandatory Fields to execute the workflow
Here’s an example of how the “Exist” activity works –
In the following example, I am continuing from the “DeleteFile” activity to check
whether the file has been deleted and not exists in the system.
1. Create a new solution or open an existing solution.
2. Drag and drop the “Exist” activity and set it as start node.
a. Double click on the activity to provide the basic details.
b. Here I am choosing the “Mode” as “File” from the drop-down as i am
going to check whether the file has been deleted.
c. Then, moving to the “FilePath” and providing the path of the deleted file.
3. Now, navigating to the “Result” in the output of the properties to declare a
variable to store the result.
a. There are two methods to store the spied value in the variable.
b. Method 1: Double-click on the variable parameter “Result” in the “Output”
section and enter a name that helps you easily identify it in the flow. Here,
I'm using the name "Exists" and using the shortcut key "Ctrl+Q" to create
the variable.
c. Method 2: Click on the variable pane, enter your preferred name (here, I'm using
"Exists"), and choose the data type as "Boolean" since the output value accepts the
booelan data type.
4. You can add a writelog activity below the “Exists” activity to view the
results.
5. Now, save and execute the workflow.
The bot will specify as “False” in the output as the file does not exists.
Click here to see how the activity works in a workflow.