/
OPERAND DATA TYPES

OPERAND DATA TYPES

The operands used in FORM FORMULAS can have the following types:

String

A String is any expression enclosed in double quotes. If it is necessary to include a double quote as part of the string, it mus be scarped by prepending a backslash symbol

Expression not enclosed in double quotes (unquoted Strings) will also be considered as Strings if:

  • It is a sequenceexpression composed by a starting number or letter and followed by a sequence of numbers or letters(uppercase or lower case) and characters underscore ("_") or colon (":")

  • The expression is not followed by an open parenthesis (otherwise it will be supposed to be the name of a function)

Valid Strings

Comments

Valid Strings

Comments

"This is a simple string"

Common string

"String with \"quoted expression\" inside

The string contains a quoted strings, and the inner double quotes are properly escaped

THIS_IS_ALSO_A_STRING

This string is not enclosed in double quotes but follows the rules to be an unquoted String

Invalid Strings

Comments

Invalid Strings

Comments

"This is a sim"ple string"

The double quote in sim"pie should be escaped

:INVALID_STRING

This string is not enclosed in double but starts with a character that is not a number or letter

MATH_SUM(34,12)

MATH_SUM is a valid sequence of characters for an unquoted string, but it is followed by a parenthesis, so it is considered a function name

Number

Any expression composed by

  • An optional '+' or '-' sign

  • A sequence of 0 or more digits to express the integer part

  • An optional decimal separator (dot character)

  • A sequence of 0 or more digits to express the fractional part

Boolean

Any expression that evaluates to 'true' or 'false' (values are case insensitive). Accepted values are:

Value

Evaluates to

Value

Evaluates to

0

false

"false"

false

"no"

false

Any number different of 0

true

"true"

true

"yes"

true

Datetime

Any expression that expresses a date in format YYYY-MM-DD and optionally a time in format "hh:mm:ss". If the time part is not expressed, it will be assumed "00:00:00"

The expression must be a valid date and time

Datetime expressions are a particular case of String and must be enclosed in double quotes

Valid Datetimes

Comments

Valid Datetimes

Comments

"2018-11-23 12:23:21"

Complete Datetime

"2018-11-23"

Datetime without time part

Invalid Datetimes

Comments

Invalid Datetimes

Comments

"2018-14-23 12:23:21"

14 is not a valid month

Time

Any expression that expresses a time in format "hh:mm:ss"

The expression must be a valid time

Time expressions are a particular case of String and must be enclosed in double quotes

Valid Times

Comments

Valid Times

Comments

"12:23:21"

 

Invalid Datetimes

Comments

Invalid Datetimes

Comments

"12:86:21"

86 is not a valid minute

JSON

Any valid JSON expression. See http://www.json.org for more details about the syntax.

JSON expressions can be enclosed in double quotes or not, but there are some differences:

  • Quoted JSON: the expression is completely static and cannot contain any part that is calculated dynamically. Note that inner double quotes must be escaped

  • Unquoted JSON: only JSON expressions that represent an object are permitted (all the expression enclosed between curly brackets). In this case it is possible to embed OBJECT CODES or references to other ITEMS in the FORM, which allows to create dynamic JSON expressions. It is not necessary to escape inner double quotes

Valid JSON

Comments

Valid JSON

Comments

"[\"Age\" : 34, \"Name\" : \"John\" ]"

This is a valid JSON expression that will be evaluated as a JSON array with values: ["Age" : 34, "Name" : "John" ]

{ "Age" : $4, "Name" : "John" }

The value "Age" property will be calculated dynamically extracting the value from the ITEM $4 of the same FORM where the FORMULA is calculated

{ "Age" : 34, "Name" : TASK.NAME }

The value "Name" property will be calculated dynamically evaluating the OBJECT CODE "TASK.NAME". Note that TASK.NAME is not enclosed in double quotes, because otherwise it would be considered a literal string

Invalid JSON

Comments

Invalid JSON

Comments

[ "Age" : $4, "Name" : "John" ]

Unquoted strings must always represent a JSON object, but this is an array

 

Related content