Boolean

A value of True or False. With the method bool() you can interpret an input as a boolean value.

Every number except the 0 is interpreted as true. Any string other than a representation of true (e.g. "True", "TrUe", "true") is interpreted as false. Empty lists or objects are interpreted as false and lists or objects with at least one item/entry as true.


input_param = 1
bool(#input_param)
true

input_paramtypebool(#input_param)
""empty stringfalse
-1numbertrue
0numberfalse
1numbertrue
TrUestringtrue
Truestringtrue
[1]listtrue
[]empty listfalse
[false]boolean listtrue
falsebooleanfalse
falsestringfalse
truebooleantrue
truestringtrue
tuerstringfalse

Date

A date object represents a date (year, month and day). You can use date(str) to create a date object from a string using auto-detection or you can use date(str, format) to get the date from an arbitrary format. Format parameter is a string containing Format Tokens.

Following methods can use dates:

The following formats are guaranteed to work with auto-detection:

Format codeExampleDescription
YYYY-MM-DD2018-07-15ISO 8601 date
YYYY-MM-DDTHH:mmZ2018-07-15T14:48+0200ISO 8601 datetime with timezone
YYYY-MM-DD HH:mm2018-07-15 14:48ISO 8601-like (not a standard)
DD.MM.YYYY15.07.2018German numeric date
DD.MM.YYYY HH:mm15.07.2018 14:48German datetime
DD.MM.YYYY HH:mm Z15.07.2018 14:48 +0200German datetime with timezone
X1531658880Unix timestamp (seconds since 1970)

WARNING

For all other formats, we highly recommended to specify the format string, as there can be cases where it fails for some dates but not others. In particular, US-style dates ("07/15/2019") will not work when the day number is below 12.

input_param = "06.04.2019"
date(#input_param)
<date 2019-04-06>

input_param = "2019/06/12"
date(#input_param)
<date 2019-12-06>

input_param = "2019/06/12"
date(#input_param, "YYYY/MM/dd")
<date 2019-06-12>

Please note that when using the date() function, the time component is explicitly discarded; it will be assumed as 0:00 UTC if needed. To supply a date and time value with timezone, please pass an ISO-8601 datetime string as documented above directly to date_convert()/date_add().

input_paramformatDate objectNotes
05/06/2019MM/DD/YYYY<date 2019-05-06>US-style date
05-06-2019DD-MM-YYYY<date 2019-06-05>British English
2019.5.6YYYY.M.D<date 2019-05-06>Japanese style date notation
5.6.2019D.M.YYYY<date 2019-06-05>German style
05.06.2019DD.MM.YYYY<date 2019-06-05>German style with 0-padding

Decimal

A positive or negative number or zero. Also called a real number. A Decimal can be any negative or positive number with approximately 300 digits.

Use the method numeric() to try to interpret an input parameter as a real number.


input_param = "1,2"
numeric(#input_param)
1.2

WARNING

The output uses the dot notation.


input_param = "abc"
numeric(#input_param)
Could not convert "abc" of type "str" to type Decimal".

input_param = "1,23a"
numeric(#input_param)
Could not convert "1,23a" of type "str" to type "Decimal".
input_paramnumeric(#input_param)
""0
"-0"0
.00
".0"0
"0"0
"1"1
"1.0"1trailing zeros are removed
11
1.1
"1."1
1.01
"1,2"1.2
"1.2"1.2
"1,0.5"10.5
"1.0,5"10.5
"1,000.5"1000.5
"1.000,5"1000.5
"1e"1
"1e+"1
"1e+1"10
"1e+2"100
"1e+3"1000
"1e1"10
"1e2"100
"1e+15"1000000000000000
"1e+16""1E+16"representation changes
11111111111111111111111111111111
11111111111111111"11111111111111111"representation changes
999999999999999910000000000000000loss of precision
99999999999999999"99999999999999999"representation changes
9999999999999999999999999999"9999999999999999999999999999"
99999999999999999999999999999"1E+29"loss of precision

Integer

A positive or negative number or zero. Also called a whole number.

You can use the method int() to interpret a Node input as an integer.


input_param = "1"
int(#input_param)
1

WARNING

Example string "1" (data type: string) was interpreted as an integer.


input_param = "abc"
int(#input_param)
Could not convert "abc" of type "str" to type "int".

input_param = "123a"
int(#input_param)
Could not convert "123a" of type "str" to type "int".

input_paramint(#input_param)
""0empty string
"-0"0
.00
0.0
"0"0
"1"1
11
1.1
1.01
1.11
"1.1"erroruse int(numeric(#input_param))
11111111111111111111111111111111
1111111111111111111111111111111112/!\
111111111111111111111111111111111100/!\
11111111111111111111111111111111111200/!\

List

List represents a data structure that can contain indexed elements of different values (e.g. integer), reference types (e.g. string) or objects.

Use [ and ]-brackets to construct a list or to access a list element.

Method list() tries to interpret a constructed list as a list.

Construct a list

input_param1 = "abc"
input_param2 = "xyz"
[#input_param1, #input_param2]
["abc","xyz"]

input_param1 = {"dummykey":"dummyvalue"}
input_param2 = "1a3"
input_param3 = 42
[#input_param1, #input_param2, #input_param3]
[{"dummykey":"dummyvalue"},"1a3",42]

WARNING

#input_param1 is an object, #input_param2 is a string and #input_param3 is an integer.

Accessing an element in a list

input_param = ["string1", "string2"]
#input_param[1]
"string2"

input_param1 = ["string1", "string2"]
#input_param1[0]
"string1"

WARNING

The integer between the square brackets represents the index of a list. The first element of a list has the index 0 (e.g. #param1[0]).

Assuming l is [#p1,#p2,#p3,#p4], then l[index] is:

indexelement
0#p10 is first element
3#p4
4""4 would be 5th element, which does not exist
-1#p4-1 is last element
-2#p3-2 second to last element
-3#p2
-4#p1
-5""would go beyond first element, which does not exist

Object

An Object represents a data structure that contains a set of string keys to values pairs.

Examples:

  1. {"ExampleKey1": "ExampleValue"}
  2. {"ExampleKey1": 123456, "ExampleKey2": ["string", 12345]}
  3. {"ExampleKey1": {"ExampleKey1": ["string", 12345], "ExampleKey2": ["string", 12345] }}

Use { and }-brackets to construct an object.

list() converts an object to a sequence of [key, value] pairs; object() does the reverse. Together with filter() and map() this can be used to modify objects.

Construct an object

#input_param = [["Brand", "Xiaomi"], ["Model", "Mi Mix"]]
object(#input_param)
{"Brand":"Xiaomi", "Model":"Mi Mix"}

Get a value from an object

To access a value from a single of multiple objects use the following methods:

WARNING

It is necessary to bundle the object or objects in a list before accessing them.

String

A string represents a sequence of zero ("") or more Unicode characters ("abc.....").

You can use the method str() to interpret an input parameter as a string object.

input_param = 123
str(#input_param)
"123"

WARNING

Example integer 123 (data type: integer) could be interpreted as a string "123".