Number of input and output field
| Number of input field |
: |
One |
| Number of output field |
: |
One |
The JSONPathParserReference function is used to extract a field value from a JSON document based on field names listed in a reference file.
The function evaluates each field name from the reference file against the JSON document, in order, until a matching field is found or all fields have been evaluated.
JSONPathParserReference has the following parameters:
- Reference File :
A file containing a list of field names, with one field name per line.
Each field in the list will be evaluated sequentially against the JSON document.
- JSON Parent Field :
An optional parameter. If specified, the parent field will be prefixed to each reference field before evaluation.
Example
JSON document:
{
"kind": "youtube#videoCategory",
"etag": "\"m2yskBQFythfE4irbTIeOgYYfBU/Xy1mB4_yLrHy_BmKmPBggty2mZQ\"",
"id": "1",
"snippet": {
"channelId": "UCBR8-60-B28hp2BmDPdntcQ",
"title": "Film & Animation",
"assignable": true
}
}
1. THe Content of reference file fields.txt
videoTitle
vidoe_title
title
titles
Applying JSONPathParserReference with the following parameters:
Reference File :fields.txt
JSON Parent Field :snippet
output
'
Film & Animation'
2. The content of reference file fields2.txt
snippet.videoTitle
snippet.vidoe_title
snippet.title
snippet.titles
Applying JSONPathParserReference with the following parameters:
Reference File :fields2.txt
JSON Parent Field :
Output
'
Film & Animation'
3. The content of reference file fields3.txt
snippet.videoTitle
snippet.vidoe_title
snippet.titles
Applying JSONPathParserReference with the following parameters:
Reference File :fields3.txt
JSON Parent Field :
Output
'
Error parsing : Json value not found'