Write to File Action—Setting Properties

The Write to File action is used to write data to a selected file. The data can be typed into the properties dialog box, or taken from a variable. You can write to an existing file or have the step create a new file along with any additional folder structure you want to add. When writing to an existing file, the step can either overwrite the file or append to it.

Variables used must be created in earlier steps using the Create Variable action.

To set Write to File properties

  1. From the Task Builder Available Actions pane, open the File folder and double-click the Write to File action or drag it into the Steps pane.

  2. In the File box, enter the path and file name, or click the Open Folder button and navigate to the file. You can use an existing file or enter a new file name and any new folder structure you want to add. The file and folders will be created at runtime.

  3. Under Method, select Overwrite file or Append at the end of the file. By default the data is appended.

  4. In the Data to write box, type the data to be written, or, if you want to use data from a variable, enter the variable name between percent signs (%VariableName%). Also, you can click the Insert Expression/Variable button and use the Expression Builder to enter a variable.

  5. If you want to record the number of bytes written, click the Advanced tab and select the variable to populate.

  6. To set the Description tab properties, refer to Description Tab Options.

  7. To set the Error Causes and On Error tab properties, refer to Step Error Handling.

  8. When finished, click OK to save settings and close the properties dialog window.

See Also

About Actions

Adding Task Steps

Write to File Action