Tinderbox v10 Icon

JSON.jsonValue(pathStr)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Data Type Returned: 

Operator First Added: 

Operator in Current Baseline: 

Operator Last Altered: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Stream parsing  [other Stream parsing operators]

 source context dependent

 v9.6.0

 Baseline

 As at baseline


JSON.jsonValue(pathStr)

The .jsonValue() operator allows a json object to be addressed by its JSON path. By comparison .json[keyStr] must use a key name. For example:

Text value:  {
  "person": { "firstName": "Thomas", "lastName": "Roe" }, 
  "coordinates": [-90,41]
}
MyString value: "person.lastName"

Then:

$Text.json['person']['lastName'] gives 'Roe'

But, easier:

$Text.json.jsonValue(person.lastName) gives 'Roe'

Or if $MyString holds "person.lastName", then:

$Text.json.jsonValue($MyString) gives 'Roe'


See also—notes linking to here: