Retailys language

Supported Literals

  • strings - single and double quotes (e.g. 'hello')

  • numbers - e.g. 103

  • arrays - using JSON-like notation (e.g. [1, 2])

  • hashes - using JSON-like notation (e.g. { foo: 'bar' })

  • booleans - true and false

  • null - null

  • exponential - also known as scientific (e.g. 1.99E+3 or 1e-2)

Supported Operators

Arithmetic Operators

  • + (addition)

  • - (subtraction)

  • * (multiplication)

  • / (division)

  • % (modulus)

  • ** (pow)

Bitwise Operators

  • & (and)

  • | (or)

  • ^ (xor)

Comparison Operators

  • == (equal)

  • === (identical)

  • != (not equal)

  • !== (not identical)

  • < (less than)

  • > (greater than)

  • <= (less than or equal to)

  • >= (greater than or equal to)

  • matches (regex match)

Logical Operators

  • not or !

  • and or &&

  • or or ||

String Operators

  • ~ (concatenation)

Array Operators

  • in (contain)

  • not in (does not contain)

Example: condition for display for sales channels only 1, 4, 8

%channelId% in [1,4,8]

Numeric Operators

  • .. (range)

Ternary Operators

  • foo ? 'yes' : 'no'

  • foo ?: 'no' (equal to foo ? foo : 'no')

  • foo ? 'yes' (equal to foo ? 'yes' : '')

Built-in Objects and Variables

Objekt %user%

  • %user.id% - the identifier of the logged in user

  • %user.language% - the language code of the logged in user

Last updated