Skip to main content
Version: 8.1


This function is used by Ignition's Expression language.


Takes a string and returns a prettyprints string, making the string easier to read by humans. Especially useful in cases where the string is displayed on components that respect carriage returns.

The image below shows a Label component with a JSON-friendly string. Below that are two Text Area components that are bound to the Label's text: one using the jsonFormat() function and the other without.



  • Parameters

    • String string - The string to format. The string must be in a JSON-friendly format; see examples below for possibilities.
  • Results

    • string - A prettyprint string of the specified string.


Code Snippet
// This example builds a JSON friendly string, and returns a prettyprint version of the string.
// Since the parameter passed is a string data type, the whole parameter must be wrapped in quotes.
Code Snippet
// Another valid JSON format - you may optionally wrap inner strings in quotation marks.