Skip to content

Write to Textfile Activity

The Write to Textfile activity enables users to store specified text content within a designated text file. This activity supports both overwriting existing file content and appending new data to the end of a file.

Field Description Requirement
Text file name Specifies the full path and name of the text file where the content will be written. If the file does not exist, it will be created. Required
Text The string content to be written to the specified text file. Required
Append Determines the write mode. If true, the provided text is added to the end of the file. If false, any existing content in the file is deleted before the new text is written. Optional

Action Types & Examples

Specify File Path

  • Format: string
  • Example Result: "C:\\Temp\\myFile.txt"

Provide Content

  • Format: string
  • Example Result: "Hello, World!"

Set Append Mode

  • Format: boolean
  • Example Result: true

Implementation Examples

Field Setup - Text file name: C:\Temp\myFile.txt - Text: Hello - Append: false

Execution Parameters - Text file name: myFileVariable - Text: contentToWrite - Append: true

Technical Notes

  • The activity will create the file specified in Text file name if it does not already exist.
  • When Append is set to false, the activity first deletes any existing content within the target file before writing the new Text. If the file is empty or newly created, the text is written directly.
  • When Append is set to true, the activity adds the new Text to the end of the existing file content without deleting previous data.
  • Ensure the provided file path is valid and the execution environment has the necessary write permissions for the target directory.
  • The activity typically uses the system's default text encoding (e.g., UTF-8) for writing content.