Skip to main content
Version: 8.1

jsonGet

This function is used by Ignition's Expression language.

Description​

Takes a JSON-friendly string and a path string, and returns the value of that path.

Syntax​

jsonGet(json, path)

  • Parameters

    • String json - The JSON string. The string must be in a JSON-friendly format.
    • String path - The path to look for in the JSON string.
  • Results

    • Object - The value at the path.

Examples​

Code Snippet
// This example takes a JSON friendly string and finds the value located at the path item.secondThing, which is 2.

jsonGet("{'item':{'firstThing':1, 'secondThing':2}}", "item.secondThing")
Code Snippet
// This example takes a JSON friendly string and finds the value located at the path item, which is {"firstThing":1,"secondThing":2}.

jsonGet("{'item':{'firstThing':1, 'secondThing':2}}", "item")