DriveWorks Pro 15: XPathJsonGet [send feedback...]

XPathJsonGet

Finds the value at a given path in a JSON string.

Syntax

XPathJsonGet([Input Data],[Path])

Where:

Input Data is the input data on which to search.

Path is the path to find in the given data object.

Examples

Example JSON data being returned to the constant DWConstantJSON

{
    books: [
    {
         title: "Harry Potter",
         price: 29.99,
     }, {
         title: "Learning JSON",
         price: 39.95
     }]
}
        
RuleMeaning
XPathJsonGet(DWConstantJSON,"books")Will return...
[
    {
        "title":"Harry Potter",
        "price":29.99},
    {
        "title":"Learning JSON",
        "price":39.95
    }
]
                        
XPathJsonGet(DWConstantJSON,"books[0]")Will return...
    {
        "title":"Harry Potter",
        "price":29.99
    }
                        
XPathJsonGet(DWConstantJSON,"books[0].title")Will return...
Harry Potter
                        
XPathJsonGet(DWConstantJSON,"books[?(@.price > 30.00)]")Will return...
{
        "title":"Learning JSON",
        "price":39.95
}
                        

This function relates to the Send HTTP Request task.

Table of Contents