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

Type Description
boolean Boolean value, either true or false.
country_code ISO-3166 country code, e.g. "it" for Italy.
date ISO-8601 date, e.g. 2020-05-01.
datetime ISO-8601 datetime, e.g. 2020-05-01T00:00:00Z.
day_of_year Day of a year in format MM/DD, e.g. 05/01 for the first of May.
email RFC5322 string, with additional validation for email address well-formattedness.
integer Number without a decimal part.
language_code ISO-639-1 language code, e.g. "sv" for Swedish.
list List of values. Supports set operations.
money Cent price in a currency. E.g. 1095 for 10,95.
number Decimal number, e.g. 1.5.
object Collection 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_number E.164 string, with additional validation for phone number well-formattedness.
set List of values which are unique in the set. Supports set operations.
string String 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.