$WBJSON - get value of JSON object

Availability
$WBJSON is available for use with all WBSP commands.

Syntax
$WBJSON{JSONSource|JSONObjectName}
$WBJSON[JSONSource|JSONObjectName]

Parameters
JSONSource - String value containing JSON to be searched. Note that this is not an URL of the JSON file but JSON source itself.
JSONObjectName - Any valid object in given JSON code including array elements. When accessing array elements use brackets () instead of square brackets []. Note that JSON object names are case sensitive.


Returns
Value of JSONObjectName.

Example

[FormFields]
wb_command=R
<!--WB_BeginTemplate-->
<html>
<head>
  <title>WBJSON</title>
</head>
<body>
$wbsetv[JSON|$wbrinc[sample.json]]
Glossary title: $wbjson[$wbgetv[json]|glossary.title]<br>
See also: $wbjson[$wbgetv[json]|glossary.GlossDiv.GlossList.GlossEntry.GlossDef.GlossSeeAlso(0)], $wbjson[$wbgetv[json]|glossary.GlossDiv.GlossList.GlossEntry.GlossDef.GlossSeeAlso(1)]
</body>
</html>

File Sample.json

{
    "glossary":
     {
      "title": "example glossary",
      "GlossDiv":
       {
        "title": "S",
        "GlossList":
         {
          "GlossEntry":
           {
            "ID": "SGML",
            "SortAs": "SGML",
            "GlossTerm": "Standard Generalized Markup Language",
            "Acronym": "SGML",
            "Abbrev": "ISO 8879:1986",
            "GlossDef":
             {
              "para": "A meta-markup language, used to create markup languages such as DocBook.",
              "GlossSeeAlso": ["GML", "XML"]
             },
            "GlossSee": "markup"
           }
         }
       }
     }
}

After running this example, the resulting page in browser should look like this:

Glossary title: example glossary
See also: GML, XML