Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
JSON data returned from a web service often contains a single parent object, which wraps child objects or arrays. If the parent object is used directly, the response will not display any detail records.
When using tExtractJSONFields to extract JSON data from a JSON string or using tFileInputJSON to read a JSON file, if the number of array elements is very large, it will take up a lot of resources. Sometimes you only need to extract JSON data that matches specific criteria, and it is more convenient to return an array of child objects instead of a parent object.
{
"array": [
{
"filename": "CoverLetter.docx",
"url": "",
"type": "cover_letter",
"created_at": "2022-01-03T19:09:12.839Z",
"price": 8.95
},
{
"filename": "Resume1.pdf",
"url": "",
"type": "resume",
"created_at": "2022-02-03T19:09:12.602Z",
"price": 10.11
},
{
"filename": "image.jpg",
"url": "",
"type": "image",
"created_at": "2023-02-27T13:01:04.786Z",
"price": 8.85
},
{
"filename": "Resume2.pdf",
"url": "",
"type": "resume",
"created_at": "2022-03-04T19:09:12.602Z",
"price": 11.11
}
]
}
$.array[?(@.type=='resume')]
$.array[?(@.type=='resume'&&@.created_at<'2022-03-01')]