Skip to main content

General Functions

General functions provide core control flow and utility operations.


IF(C, A, B)

Returns A if condition C is true, otherwise returns B.

IF( price > 50, "Too high", "Acceptable" )

SWITCH(R, A, X, ...)

Compares the reference value R with multiple values.

  • if R equals A, returns the corresponding X
  • supports multiple A, X pairs
SWITCH( number, 0, "Zero", 1, "One", 2, "Two", 3, "Three" )
SWITCH( number % 2, 0, "Number is even", 1, "Number is odd" )

FOR(F, T, [S])

Creates an array of numbers.

  • starts at F (from)
  • increments by S (step, optional, default = 1)
  • continues while values are ≤ T (to)
FOR( 0, 5 )
FOR( 1, count, 1 )

NEXTCOUNTER(C)

Returns the next value of a counter identified by C.

NEXTCOUNTER( "ticketNumber" )

PROPERTY(O, P)

Returns property P from object O.

PROPERTY( address, "street" )

DEFAULT(V, D)

Returns default value D if V is empty, otherwise returns V.

DEFAULT( number, 0 )
DEFAULT( status, "Unknown" )

PHONE_COUNTRY_CODE(P)

Returns the country code from a parsed phone number P.

PHONE_COUNTRY_CODE( phone )

PHONE_NATIONAL_NUMBER(P)

Returns the national number from a parsed phone number P.

PHONE_NATIONAL_NUMBER( phone )

Was this article helpful?

Yes
No