FORMAT_JSON_TEMPLATE

Description

Parses and formats a JSON template string by resolving embedded expressions and merge fields into JSON-formatted output.

Syntax

FORMAT_JSON_TEMPLATE(template) -> String

Parameters

ParameterData TypeRequiredDescription
templateStringYesA JSON template string containing merge fields or expressions in template syntax to be evaluated and serialized into JSON-formatted output. Incorrect or unparseable expressions remain as literal text in the output.

Example

FORMAT_JSON_TEMPLATE(
'{
  "accountName": {!Account.Name},
  "stageName": {!StageName},
  "amount": {!Amount},
  "isClosed": {!IsClosed}
}'
)
-- Returns a JSON string populated with record data.
{
  "accountName": "Owens LLC",
  "stageName": "Prospecting",
  "amount": 125000,
  "isClosed": false
}

Related Formula