Available filtersList of filters that can be used to generate validations, triggers, and templates.falseW3sidGl0bGUiOiJBdXRvbWF0aW9uIiwidXJsIjoiL2RldmVsb3BlcnMvYXV0b21hdGlvbi8ifSx7InRpdGxlIjoiUGlwZUxhbmciLCJ1cmwiOiIvZGV2ZWxvcGVycy9hdXRvbWF0aW9uL3BpcGUtbGFuZy8ifSx7InRpdGxlIjoiRXhwcmVzc2lvbiBsYW5ndWFnZSIsInVybCI6Ii9kZXZlbG9wZXJzL2F1dG9tYXRpb24vcGlwZS1sYW5nL2V4cHJlc3Npb25sYW5ndWFnZS8ifV0=Automation/developers/automation/["developers","Automation"]["developers","Automation","PipeLang"]developers
Available filters
List of filters that can be used to generate validations, triggers, and templates.
(order.orderProducts | last).canceled # Condition will be met, if the last item in order is in cancellation status
contains
Returns true, if at least one item of collection matches the condition
order.orderProducts | contains(item => item.status.code == "in-reserve") # Condition will be met, if at least one item in order is in "In reserve" status
every
Returns true, if all items of collection match the condition
# Attention! Condition also will be met for empty collection
order.availableOrderProducts | every(item => item.status.code == "in-reserve") # Condition will be met, if if all not cancelled items in order are in "In reserve" status
filter
Returns the collection filtered by some condition
order.orderProducts | filter(item => item.summ > 1000 ) | contains(item => item.status.code == "in-reserve") # Condition will be met, if at least one item with sum more than 1000 is in "In reserve" status
map
Changes each item of collection
order.orderProducts | map( x => x.offer ) # converts the collection of order items to the collection of offers
reduce
Returns the result of calculation aggregated the entire collection
Converts the two-dimensional collection into one-dimensional
(order.orderProducts | map ( x => x.packs ) | flatten | sort( (a, b) => a.shipmentDate < b.shipmentDate) | first).shipmentDate < order.deliveryDate # condition will be met, if maximum date of items picking is less than delivery date
sort
Sorts the collection by specified condition
(order.availableOrderProducts | sort( (a, b) => a.summ < b.summ ) | first).status.code == "in-reserve" # Condition will be met, if the most expensive item in order is reserved
length
Returns the quantity of collection items
(order.orderProducts | length) > 5 # Condition will be met, if there are more than 5 items in order
is_subscribed
Returns the customers's subscription flag (type Customer) to the specified channel (email, sms or waba).
customer|is_subscribed('sms')
You can also check subscription to a specific category in the channel by passing the subscription category code as the second argument.