Given a json list, for example:
{ "listRel:customFieldList": { "platformCore:customField": [ { "@internalId": "801", "scriptId": "custentity_admin_contact_cweb", "@xsi:type": "platformCore:BooleanCustomFieldRef", "platformCore:value": "false" }, { "@internalId": "712", "@scriptId": "custentity_bar_number", "@xsi:type": "platformCore:StringCustomFieldRef", "platformCore:value": "166493" }, { "@internalId": "798", "@scriptId": "custentity_contact_type", "@xsi:type": "platformCore:SelectCustomFieldRef", "platformCore:value": { "@internalId": "1", "@typeId": "148", "platformCore:name": "Attorney" } } ] } }
How to select a value in "custentity_bar_number"? 166493?
This will take you there, but only if you remove the @ symbol before @scriptId in JSON.
$..['platformCore:customField'][?(@['scriptId'] == 'custentity_bar_number')]
So, I need a way to escape the @ character in json and do something like this work:
$..['platformCore:customField'][?(@['@scriptId'] == 'custentity_bar_number')]
I am using http://jsonpath.com/ to try and do this work.
json jsonpath
redwards510
source share