Skip to content

Data types

Every datum stored in Custobar has a data type, which defines how the datum can be used. For example a number can be compared to another, to find out whether it is greater or less than another number.

The data types supported by Custobar are

TypeDescription
booleanBoolean value, either true or false.
country_codeISO-3166 country code, e.g. "it" for Italy.
dateISO-8601 date, e.g. 2020-05-01.
datetimeISO-8601 datetime, e.g. 2020-05-01T00:00:00Z.
day_of_yearDay of a year in format MM/DD, e.g. 05/01 for the first of May.
emailRFC5322 string, with additional validation for email address well-formattedness.
integerNumber without a decimal part.
language_codeISO-639-1 language code, e.g. "sv" for Swedish.
listList of values. Supports set operations.
moneyCent price in a currency. E.g. 1095 for 10,95.
numberDecimal number, e.g. 1.5.
objectCollection of values keyed with a string. For example customers are objects of values, such as first_name and last_name, which in turn are strings.
phone_numberE.164 string, with additional validation for phone number well-formattedness.
setList of values which are unique in the set. Supports set operations.
stringString of characters.

When designing a schema for your data, you must pick a data type for each of the fields, before they can be used in Custobar.

During the data import the fields in the import file are checked for validity according to the data type constraints and converted if possible. For example, you cannot import a string value, such as "Peter" into a field of type integer.