Copy Folder

This activity is used to copy a folder from one location to another specified location even if
the folder is in read-only format. We can also copy a file from a shared folder, granted we
have access to it.

Technical Reference

 

 

 

INPUT

From: Indicates to specify the path in which the folder to be copied 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.

IncludeSubFolder: Check this box if the sub folders within the folders must be copied.

If this box is left unchecked, only the files in the folder are copied to the given location and the folders inside this folder are not copied.

By default, it is unchecked.

Overwrite: Check this box if you want to overwrite the folder if it is already available in the path that you have chosen.

By default, it is unchecked. This means if the zipped folder which we are trying to save to a location is already available there, it wouldn’t get saved in that location.

To: Specify the path to which the folder has to be copied.

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.”
True: Continues to execute the workflow irrespective of any error thrown.
False: Stops the workflow if it throws any error.
None: If the option is specified as blank, by default the activity will perform the “False” action.

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.
True: It indicates that the activity has been executed successfully without any error.
False: It indicates that the activity has been unsuccessful due to some unexceptional error thrown.

*Represents mandatory Fields to execute the workflow

Let’s see how the copy folder activity works.

1.      Create a solution to build a workflow.

2.      Install the "FSAutomation" feature from "Manage Features."

3.      Drag and drop the "CopyFolder" activity onto the designer pane.

a.      Double-click the activity.

b.      Enter the “from” path of the folder to be copied and the “to” path
to which the folder has to be copied.

 

4.       Navigating to the “Result” in the properties to
declare a variable to store the output in a variable.

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 "CF" 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 "Test"), and choose the data type as "String" since the output
value accepts the string data type.

5.      Drag and drop a write log activity below the “Copy file” activity and enter the above
declared variable with the extension “.ToString” to convert the result from “Boolean”
datatype to “string” datatype. Here it is “CF.ToString”.

             

6.      Execute the workflow.

Click here to know how the activity is used in a workflow.