You're currently browsing the Ignition 8.0 docs. Click here to view the latest docs.

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")
  • No labels