=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.
Syntax
Section titled “Syntax”=JSONENCODE(TextParameter)Parameters
Section titled “Parameters”- TextParameter – The text or field value to encode as a JSON string.
How It Works
Section titled “How It Works”-
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.
Usage Notes
Section titled “Usage Notes”-
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.
Example
Section titled “Example”=JSONENCODE(TextLine1TextLine2TextLine3)Returns
“TextLine1\nTextLine2\nTextLine3”
Keywords
Section titled “Keywords”JSONENCODE, JSON text, encode string, JSON formatting, API data, escape characters, text encoding, formula function