Object To File
Writes a text or an object into a new file, with the encoding and line endings you choose.
Object To File writes a value into a new file. Use it to save a JSON object as a .json file, a text as a .txt or .csv file, or any generated content that another system expects as a file.
Add the action
In the Process Designer toolbox, open Documents and pick Object To File (or type Object To File in the search box).

Inputs and outputs
| Field | Direction | Type | Required | What to put / what you get |
|---|---|---|---|---|
| Object | Input | Object (JSON) or Text | Yes | The value to write. |
| Filename | Input | Text | Yes | The file name with an extension, for example customer.json. |
| Encoding | Input | Option | Yes | The character set of the file. Default UTF8. Also: UTF32, ASCII, Unicode (UTF-16), BigEndianUnicode, Latin1 and Windows code pages 1250โ1258. |
| Line Ending | Input | Option | Yes | Windows (CRLF) (default), Unix (LF) or Mac (CR). |
| File | Output | File | Yes | The new file. |
Example
| Object | Filename | Encoding / Line Ending | Content of File |
|---|---|---|---|
{"name":"Ana","tags":["a","b"]} | ana.json | UTF8 / Unix (LF) | The JSON, indented on several lines |
line one + new line + line two | note.txt | UTF8 / Windows (CRLF) | line one and line two separated by CRLF |
ฤรฎศ cafรฉ | a.txt | ASCII | ??? caf? |
x | noext | โ | The step fails: "Input error: File name must contain a valid extension." |
Good to know
- An object is written as indented JSON. A text is written as it is.
- Line Ending converts the line breaks inside the value to the style you pick.
- Pick an encoding that can hold your characters. ASCII and the Windows code pages replace the characters they do not have with
?. - UTF8 files are written without a byte order mark (BOM).
- An empty Object makes the step fail with "Input error: Input object is null.".
- To write a list, use List To File. To read a file back into a text, use File To String.

