$WBJSONELEM - get element names of JSON object

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

Syntax
$WBJSONELEM{JSONSource|JSONObjectName}
$WBJSONELEM[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
Comma-separated list of element names of JSONObjectName.

Example

[FormFields]
wb_command=R
<!--WB_BeginTemplate-->
<html>
<head>
  <title>WBJSONELEM</title>
</head>
<body>
$wbsetv[JSON|$wbrinc[sample.json]]
Elements of GlossEntry: $wbjsonelem[$wbgetv[json]|glossary.GlossDiv.GlossList.GlossEntry]
</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:

Elements of GlossDef: ID,SortAs,GlossTerm,Acronym,Abbrev,GlossDef,GlossSee