# Boolean
A value of True or False. With the method bool you can interpret an output 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
# 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 code | Example | Description |
---|---|---|
YYYY-MM-DD | 2018-07-15 | ISO 8601 date |
YYYY-MM-DDTHH:mmZ | 2018-07-15T14:48+0200 | ISO 8601 datetime with timezone |
YYYY-MM-DD HH:mm | 2018-07-15 14:48 | ISO 8601-like (not a standard) |
DD.MM.YYYY | 15.07.2018 | German numeric date |
DD.MM.YYYY HH:mm | 15.07.2018 14:48 | German datetime |
DD.MM.YYYY HH:mm Z | 15.07.2018 14:48 +0200 | German datetime with timezone |
X | 1531658880 | Unix 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()
.
# 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.
You can 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".
# 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".
# 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]
).
# Object
An Object represents a data structure that contains a set of string keys to values pairs.
Examples:
{"ExampleKey1": "ExampleValue"}
{"ExampleKey1": 123456, "ExampleKey2": ["string", 12345]}
{"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".