This method is used to select the specified item from the parsed JSON-formatted data. Based on the selected item, further methods can be executed.
The element is specified using an JPath expression. If the JPath expression matches several elements, the first matching item is selected. If a null string is assigned to the input i_sJPath, the root item is selected.
On each call, the search of the specified item is started from the beginning of the parsed data. That is, using the same JPath expression always results in the same element being selected.
The return value of type BOOL indicates TRUE if an element was successfully selected. If an error has been detected use the properties Result and ResultMsg to obtain the result of the method.
In case the requested item could not be selected, the previously selected item remains selected.
Input |
Data type |
Description |
---|---|---|
i_sJPath |
STRING [255] |
JPath expression to specify the item to be selected. If a null string is assigned, the root item is selected. |
Use the syntax of the JPath language to specify the item to be selected.
The table lists the supported JPath expressions:
JPath expression |
Description |
---|---|
|
Selects the first item with the specified name at the first level. |
|
Selects the first item matching the specified absolute path. |
|
Selects the first array element matching the specified absolute path. |
|
Selects the child item of the first array element matching the specified absolute path. |
The following example shows how to use the JPath expression to select an item out of a JSON-formatted data:
JPath expression |
Parsed JSON data |
---|---|
|
|