Skip to content

=JSONENCODE

The =JSONENCODE() function converts a text value into a JSON-encoded string, allowing it to be safely used as a JSON property value. Line breaks and special characters are escaped according to JSON formatting rules.

=JSONENCODE(TextParameter)
  • TextParameter – The text or field value to encode as a JSON string.
  • Takes the provided text and escapes characters as needed for JSON compatibility.

  • Converts line breaks (\n), quotes, and other special characters into a valid JSON format.

  • Returns a single string enclosed in quotes.

  • Useful when preparing text for JSON APIs or data exchange.

  • Works with multi-line text or field tokens.

  • Formula function names are case sensitive and must be written in ALL CAPS.

=JSONENCODE(TextLine1
TextLine2
TextLine3)

Returns

“TextLine1\nTextLine2\nTextLine3”


JSONENCODE, JSON text, encode string, JSON formatting, API data, escape characters, text encoding, formula function