The condition informs the path that the integration flow should follow when the information described there appears in the body of the request/response payload of the step preceding Choice V2.
To define the condition, you must use a JSONPath expression.
NOTEJSONPath is a query language for JSON that allows you to select and extract data from a JSON document. You use a JSONPath expression to traverse the path to an element or set of elements in the JSON structure.
In the image below, the condition described for WHEN indicates that if the "city" element equals "São Paulo", the flow should follow that path. If the information is different from this, the flow will follow another path defined in another WHEN condition or OTHERWISE.

Now imagine you have the response payload from a previous step with the following information:
Thus, since the payload has the city element information equal to São Paulo, the flow will follow the path indicated in the WHEN condition, as seen in the image.
To better understand the composition of a condition, let's look at the main syntax rules for JSONPath expressions:
Now see examples of expressions, based on the JSON structure below:
NOTEModified and expanded structure from Stefan Goessner.
Operators | Expression | Meaning |
|---|---|---|
== (equal) | $.store.book[?(@.category == "fiction")] | returns books in the fiction category. |
!= (not equal to) | $.store.book[?(@.author != "J. R. R. Tolkien")] | returns books whose author is not J. R. R. Tolkien. |
> (greater than) | $.store.book[?(@.year > 1980)] | returns books released after 1980. |
>= (greater than or equal to) | $.store.book[?(@.year >= 2000)] | returns books released in or after the year 2000. |
< (less than) | $.book[?(@.price < 10)] | returns books with a price less than 10. |
<= (less than or equal to) | $.store.book[?(@.price <= 15)] | returns books with a price less than or equal to 15. |
=~ (matches JavaScript RegEx) | $.store.book[?(@.category =~ /fic.*/i)] | returns books that belong to a category starting with "fic". |
! (negates the filter) | $.store.book[?(!@.isbn)] | returns books that do not have an isbn number. |
&& (logical AND operator) | $.store.book[?(@.category=="fiction" && @.price < 10)] | returns books in the fiction category with a price less than 10. |
|| (logical OR operator) | $.store.book[?(@.category=="fiction" || @.price < 10)] | returns books in the fiction category or with a price less than 10. |
in | $.store.movie[?(@.category in ["documentary"])] | returns movies that are in the documentary category. |
nin | $.store.movie[?(@.category nin ["fantasy"])] | returns movies that are outside the fantasy category. |
subsetof | $.store.movie[?(["fantasy"] subsetof @.category)] | returns fantasy movies if fantasy is a subset of the movie categories. |
contains | $.store.book[?(@.title contains "Moby Dick")] | returns the title "Moby Dick" if it exists among the available titles. |
size | $.store.book[?(@.title size 9)] | returns book titles that have 9 characters, including spaces. |
empty true | $.store.book[?(@.isbn empty true)] | returns books that have isbn as an empty value. |
empty false | $.store.book[?(@.isbn empty false)] | returns books that have isbn as a non-empty value. |
We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more