Supported Operators
Copy the link to the article
Copied

Arithmetic operators

& nbsp; & nbsp; & nbsp; + addition & nbsp; & nbsp; & nbsp; - subtraction & nbsp; & nbsp; & nbsp; * multiplication & nbsp; & nbsp; & nbsp; / division & nbsp; & nbsp; & nbsp; % modulo division & nbsp; & nbsp; & nbsp; ** exponentiation & nbsp; & nbsp; & nbsp; ~ string concatenation

order.totalSumm * 0.01 # 1% of the order amount
order.summ + order.deliveryCost # sum of products + delivery cost
order.id~'API' # 12345API

Comparison operators

== (==) equals === (===) identical (equal in value and type) != (! =) does not equal !== (! ==) is not identical < less > greater <= less than or equal >= greater than or equal matches matches regular expression not matches does not match regular expression

Note

Note that in regular expressions / is a special character and must always be escaped. For example, /d should be written as //d

order.status.groupCode == "approval" # order status in the Coordination group
order.deliveryCost <= 500 # delivery cost of the order is less than or equal to 500
order.source.thisName matches "/yandex/" # the order with "yandex" in the source
order.customerComment not matches "/test/" # operator comment does not contain the word "test"

Boolean operators

not negation and boolean and or boolean or

order.quantity < 2 and not changeSet.hasChangedField ("status") # the total number of products in the order is less than 2 and the order status has not changed
changeSet.hasChangedField ("delivery_cost") or changeSet.hasChangedField ("delivery_net_cost") # the cost or the prime cost of the delivery has changed

Operators for working wirh arrays

in is in the array not in is not in the array

changeSet.hasChangedField("status") and changeSet.newValue("status").groupCode in ["complete", "cancel"] 
# order status changed to status from the Completed or Canceled groups
changeSet.hasChangedField ("delivery_type") and changeSet.newValue ("delivery_type"). code not in ["russian-post", "sdek"] # delivery type changed to any, except Russian post or SDEK
Thank you for your feedback.
Was this article helpful?
No
  • Рекомендации не помогли
  • Нет ответа на мой вопрос
  • Текст трудно понять
  • Не нравится описанный функционал
Yes
Next article
Available functions
Main and auxiliary functions available when working with system objects.