Read File
Read File
Section titled “Read File”Type: read-file · Package: Filesystem Activities v1.0.0 · Output: string
Reads the entire contents of a text file and returns it as a string. Use it to read .txt files, templates, logs, configurations or any plain text content.
How it works
Section titled “How it works”Opens the file at the given path and returns all its contents as a single string. If the file does not exist, the activity fails. Save the result in an output variable.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
path | expression | Path of the file to read. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
encoding | text | File encoding. By default "utf-8". |
Output
Section titled “Output”Returns a string with the contents of the file.
Example
Section titled “Example”Read File path = = asset("plantilla_correo.txt") → output: plantillaSet Variable name = cuerpo value = = replace(plantilla, "{nombre}", cliente.nombre)Related activities
Section titled “Related activities”- Write File — write a text file.
- File Exists — check before reading.
- Append to File — add text without deleting existing text.