PROCESIO
OverviewPlatform ActionsIntegrations & DemosMarketplaceCustom ActionsDeveloperโ€™s Guide

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).

The Object To File action properties: Object, Filename, Encoding, Line Ending and File

Inputs and outputs

FieldDirectionTypeRequiredWhat to put / what you get
ObjectInputObject (JSON) or TextYesThe value to write.
FilenameInputTextYesThe file name with an extension, for example customer.json.
EncodingInputOptionYesThe character set of the file. Default UTF8. Also: UTF32, ASCII, Unicode (UTF-16), BigEndianUnicode, Latin1 and Windows code pages 1250โ€“1258.
Line EndingInputOptionYesWindows (CRLF) (default), Unix (LF) or Mac (CR).
FileOutputFileYesThe new file.

Example

ObjectFilenameEncoding / Line EndingContent of File
{"name":"Ana","tags":["a","b"]}ana.jsonUTF8 / Unix (LF)The JSON, indented on several lines
line one + new line + line twonote.txtUTF8 / Windows (CRLF)line one and line two separated by CRLF
ฤƒรฎศ™ cafรฉa.txtASCII??? caf?
xnoextโ€”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.

On this page