Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

USE:

JSONPath expressions are used to operate on JSON messages.

For testing JSONPath expressions see Int4 IFTT Expression Test Tool 

Int4 IFTT supports JSONPath expressions in dot-notation.

Here is a list of supported syntax elements and their XPath equivalents.

XPath

JSONPath

Description

/

$

root element/object

//

..

recursive descent

*

*

wildcard (all objects)

[]

[]

collection/array operator

Examples:

JSON file:

{
    "order": {
        "item": [{
                "category": "Monitors",
                "itemText": "LCD Monitor 22 inch",
                "price": 128.95
            }, {
                "category": "Printers",
                "itemText": "Label Printer",
                "price": 56.99
            }, {
                "category": "Monitors",
                "itemText": "LCD Monitor 24 inch Full HD",
                "price": 211.99
            }, {
                "category": "Printers",
                "itemText": "Laser Printer",
                "price": 77.99
            }
        ],
        "paymentTerms": {
            "code": "N30",
            "description": "Payment 30 days after invoice date"
        }
    }
}
  1. All item texts
    JSONPath: $.order.item[*].itemText

    Result:
    LCD Monitor 22 inch

    Label Printer

    LCD Monitor 24 inch Full HD

    Laser Printer

  2. Price of 3rd item
    JSONPath: $.order.item[2].price

    Result:
    211.99

  3. All categories
    JSONPath: $..category

    Result:
    Monitors

    Printers

  • No labels