Filter

Description

The Filter component is a component that filters the data that passes the contents of the input payload to the next component and outputs it to the output payload.

You can enter a conditional expression that allows you to pass a test if it's true, or not.
The conditional expression is written with variables with tp. / tv. / ap. / av. / cp. / cv. prefixes as comparison targets.

Condition ExampleFormula
Payloads are targeted and Payloads are numerical in naturecv.Payload > 10
Stringcv.Payload =~ "^abc"
JSON Arraycv.Payload[1] > 10
JSON Objectcv.Payload.key1 == "abc"

The expression field supports basic operators such as ^ to indicate the start of a string.

Component Properties

NameDescription
ConditionWrite a conditional expression

Available Modifiers

Modifiers+ - / * & | ^ ** % >> <<
Comparators> >= < <= == != =~ !~
Logical Ops|| &&

Examples

If you like the action to stop unless the JSON value book_id of the first book in the books array in tv.Data payload is set to 12345, you can use a Comparator, for example tv.Data.books[0].book_id == 12345

You can also use pre-mapping to prepare the data for the filter component. For example:

action-component-filter-premapping