JSON Formatting

Programmable layouts are often utilised to ensure content is safe to be used in JSON output.

A jsonString Custom Helper was created to make this process easier. If you'd like to see the underlying code from this Custom Helper you can check out this doc on Confluence.

How it's used:

{{ jsonString (thing-to-be-escaped) }}

Example

{
  "Plain text": "{{jsonString (publish element="Text element") }}",
  "HTML": "{{jsonString (publish element="HTML element") }}",
  "Media": "{{jsonString (publish element="Media element") }}",
  "List": "{{jsonString (outputSelected(selected element="Checkbox")) }}"
}

 


{
  "Plain text": "",
  "HTML": "",
  "Media": "",
  "List": ""
}