Filter Description
first Returns the first item of collection
Examples
(order.availableOrderProducts | first).status.code == "in-reserve"
last Returns the last item of collection
Examples
(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
Examples
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
Examples

# 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
Examples
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
Examples
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
Examples
# Order content:
#   Skirt  2 pcs
#   Shorts 1 pcs
#   Shirt  5 pcs

order.availableOrderProducts | reduce( (sum, x) => sum + x.quantity ) # 8
order.availableOrderProducts | reduce( (sum, x) => sum + x.quantity, 7 ) # 15
flatten Converts the two-dimensional collection into one-dimensional
Examples
(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
Examples
(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
Examples
(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).
Example
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. Example
customer|is_subscribed('email', 'news')