Types of fields in the database
Default database fields
This table provides a list of default database fields, their API matches, data types, and examples of values that can be used.
Field in the database | Field name in the API | Field type in the UI | The type of the field in the API | Example of the value |
---|---|---|---|---|
Line/Email | string | "example@example.com" | ||
Phones | phones | Phone list | array | ["+79001234567"] |
Name | _fname | Line | string | "John" |
Last name | _lname | Line | string | "Doe" |
Date of birth | _bdate | Date | string | "2001-12-31" "2001-12-31T00:00+03:00" The time can only be transmitted via the API. |
Gender | _sex | Enum | string | "male" "female" |
Date of reg. | _regdate | Date | string | "2023-12-31" "2023-12-31T23:59:59+03:00" |
The IP address of the reg. | _regip | IP | string | "127.0.0.1" |
City reg. | _regcity | Line | string | "Moscow" |
Country reg. | _regcountry | Line | string | "Russian Federation" "RU" |
Link reg. | _regurl | Line | string | "https://example.com" |
IP address | _ip | IP | string | "127.0.0.1" |
City | _city | Line | string | "Moscow" |
Country | _country | Line | string | "Russian Federation" "RU" |
Region | _region | Line | string | "Europe/Moscow" |
Index | _postal_code | Line | string | "190000" |
Time zone | _tz | Line | string | "Europe/Moscow" |
Supplier | _vendor | Line | string | "form #30" |
Custom database fields
The type of field determines which operators will be available in segments and in dynamic template variables, so we recommend carefully choosing the type of additional field in the database.
Field type in UI | Field type in API | Example of the value |
---|---|---|
Integer | int | 100 |
Float | float | 100.5 |
Line | string | "string value" |
Date | string | "2024-05-27T12:00:00Z" |
Boolean | boolean | true false |
Enum | string | "Option 1" You can also pass a value as a number, for example, 1. The number corresponds to the ordinal number of the item in the list. |
IP | string | "127.0.0.1" |
Tags | array | ["Tag 1", "Tag 2", "Tag 3" ] |
Object | object | { "key_1": { "sub_key": "sub_value" } } |
Array of objects | array of objects | [ { "key_1": "value_1" }, { "key_2": "value_2" } ] |
Acceptable formats and restrictions
The platform expects certain value formats for each type of field. Make sure that the imported data meets the specified requirements, otherwise the system will not be able to process them correctly.
- Email — the format must comply with RFC standards. A regular expression is used for validation:
^[-a-z0-9!#$%&'*+/=?^_{|}~]+(\.[-a-z0-9!#$%&'*+/=?^_{|}~]+)*@((?:localhost|([a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?\.)*([a-z]{1,24})))$
-
Phones — the number must correspond to the international format (without spaces, hyphens and other separators, except for the plus sign at the beginning). More information about the standard can be found in this article.
-
Dates — are recorded in the format RFC 3339 (ISO 8601) indicating the time zone.
-
Country — accepted as a two-letter code ISO 3166-1 alpha-2 or the full name (in any case).
-
Gender — acceptable values are described in this article.
-
Provider — the length of the string is no more than 26 characters.
-
IP — IPv4 format.
-
Line — it is not recommended to store more than 100 KB of text in one field.
-
Objects and arrays of objects — you can write only peer-to-peer objects or peer objects nested in other objects. If you are using objects with a more complex structure, connect the SQL database and create queries to select profiles. In object field names, only Latin letters (in any case), digits from 0 to 9, the underscore
_
, and the hyphen-
are allowed. -
The limit on the amount of data of one profile in the database is 16 MB, including all metadata. However, it is not recommended to store a total of more than 2 MB in additional profile fields.
Matching of database fields and form elements
If you are configuring profile data import from form fields to database fields, make sure that you are using the correct field type for each form element.
Form element | Field in the database |
---|---|
Short text | Custom field with the “String" type |
Default ”Email" field | |
Phone number | Default field “Phones” |
Long text | Custom field with the “String" type |
Number | Custom field with the “Integer” type |
Yes/No | Custom field with the “Boolean” type |
One choice | Custom field with the “String" type |
Multiple choice | Custom field with the “Tags" type |
Drop-down list | Custom field with the “Tags" type |
Date | Default or custom field with the “Date” type |
Range | Custom field with the “Integer” type |
Although you can write all user data in string fields, this will limit the possibilities for further segmentation. For example, if the date is written in a string field, you will not be able to use the comparison operators "date less" or "date more" in segments or templates.