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.

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.

FilePath: Indicates to provide the path where the folder needs to be created. 

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.

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.      Here, I am providing the "FileName" as "Sample" in which the name of the file
needs to be created. 

b.      Then, moving to the "file path" to choose the path. You can also choose the file
name by clicking on the three dots adjacent to the field name.

5.      Declare and assign a new variable in Result tab. This is done to see the success
state of the activity. 

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 "Test1," 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.

7.      Now, execute the workflow.

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