Skip to main content

Supported Variable Types

What are the supported variable types in the REST API?

Written by Lenka Haringerová

Variable types are used when exporting to and importing from XML or JSON, and when filtering.

Machine name

Name

Note

Example

string

String

The encoding is Unicode, so any character can be used.

šílený koníček
こちらは田中さんです

integer

Integer

Must not contain spaces. It is a signed 4-byte integer, although the range may be limited (see the overview of fields for the given record type).

12

numeric

Decimal number

Must not contain spaces; the decimal separator is a dot. It is an 8-byte double, although the range may be limited (see the overview of fields for the given record type).

12.5

date

Date

Date in the format YYYY-MM-DD; a time zone can also be specified (YYYY-MM-DDZZZ), but it will be ignored. ZZZ denotes the time zone (Z or +HH:MM or -HH:MM).

1980‑05‑06
2015‑01‑30Z
2008‑09‑01+02:00

datetime

Date + time

Date and time in the format YYYY-MM-DD'T'HH:MM:SS.SSS; a time zone can also be specified (YYYY-MM-DD'T'HH:MM:SS.SSSZZZ), but it will be ignored. ZZZ denotes the time zone (Z or +HH:MM or -HH:MM).

  • The supported formats are based on the W3C specification.

  • For filtering, only the notation without a time zone can be used.

  • In imported values, you can use ${currentYear} instead of YYYY — the current year will be used as the actual value.

1980‑05‑06
1980‑05‑06T12:30:12
2015‑01‑30T22:55:33Z
2008‑09‑01T17:18:14+02:00
2008‑09‑01T17:18:14.075+02:00

logic

Boolean value

boolean

true
false

select

Selection of one value

A selection of one value. Represented as a string.

typVztahu.odberDodav

relation

Link between data

The input is a record from another record type (see the overview of identifiers).

123
code:CZK


Current year in values and in filters

The placeholder text ${currentYear} and the filter function currentYear() are often confused. They are not the same thing and are not interchangeable:

Notation

Where it is used

Example

${currentYear}

In imported values of type date and datetime instead of the YYYY part

<datVyst>${currentYear}-06-15</datVyst>

currentYear()

In a filter, over properties that carry the year as a number (e.g. platiDo)

/cenik/(platiDo <= currentYear())

now()

In a filter over properties of type date and datetime

/faktura-vydana/(datSplat < now())

⚠️ ${currentYear} does not work in a filter — such a query will fail with the error 400. For date properties, use now() in the filter, or specify the year as a number.


Related

Did this answer your question?