Create File

This activity helps the user to create a new file in the specified location. We can also
create a file in a shared folder, granted we have access to it.

Technical Reference

 

 

 

 

 

 

 

 

 

 

 

   INPUT

Extn: "Specify the desired file type by selecting the appropriate extension for creation. From the dropdown, choose one of the following:
Txt: This option generates a Notepad document. It is the default selection.
Xlsx: This option enables the creation of an Excel spreadsheet document.
Docx: This option generates a Microsoft Word document compatible with versions from 2007 onwards.
Doc: This option enables the creation of a Word document for versions before 2007."

FileName: Specify the name of the file to be created. It accepts the “String” datatype.

FilePath: Indicate the path where the folder needs to be created or manually select it by clicking the area adjacent to the file path when the activity is double-clicked. It accepts the “String” datatype.

Overwrite: When this parameter is checked, it allows you to overwrite the file. If the parameter is unchecked, the file will not be overwritten. By default, this parameter is unchecked.

 

 

 

 

 

 

 

 

 

      MISC

Display Name: Displays the name of the activity. The activity name can also be customized to 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 the activity has been executed successfully without any error.
False: It indicates that the activity has been faulted due to some unexceptional error thrown.

* Represents mandatory fields to execute the workflow.

The following activity illustrates how we can create a new file in a specified folder.

1.      Create a new solution or open an existing solution.

2.      Drag and drop the Create File activity from FS Automation.

3.      Double click on the activity.

 

a.     
Provide the "FileName." In this case, we are using the file name as "Sample”.

 

b.      Provide the file path where the file needs to be created, or by clicking on the adjacent
area, you can choose the path. In this example, we have chosen the folder name as 'Test'."

5.      Declare and assign a new variable in Result tab. This is done to see the success state of the
activity. Here it is “CF”. This is in “Boolean” datatype.
 

6.      Drag and drop the "WriteLog" activity next to the "CreateFile" activity to observe the success
state of the activity.

a.      Enter the input string. Here, I'm using "CF," which was declared in the "Result" parameter
of the "CreateFile" activity. The reason for providing ".Tostring" is to convert the
“Boolean” datatype to “String” datatype.

b.     Here it “CF.ToString”

 

7.      Now, execute the workflow.

The bot creates a new Microsoft word document in the specified location.

 

 

v4.0.2