Bitrix24 Helpdesk

BI Builder datasets: Companies and contacts

A dataset is a set of information about leads, deals, companies, contacts, and other Bitrix24 items. Each item has several datasets that pull data automatically from system fields and custom fields. You can use datasets to build charts and analyze business metrics.

In this article:

Datasets:

Examples:


Datasets

Select a dataset and create a chart.

Company — crm_company: Includes basic information about companies, such as their names, industry, details, and responsible users.

Company — crm_company

Field Description Data type
ID Company ID Number
DATE_CREATE Date and time the company record was created Date
DATE_MODIFY Date and time the company record was last updated Date
CREATED_BY_ID ID of the user who created the company record Number
CREATED_BY ID and name of the user who created the company record String
CREATED_BY_NAME Name of the user who created the company record String
MODIFY_BY_ID ID of the employee who updated the company record Number
MODIFIED_BY_NAME Name of the employee who updated the company record String
MODIFIED_BY ID and name of the employee who updated the company record String
ASSIGNED_BY_ID Responsible person ID Number
ASSIGNED_BY ID and name of the responsible person String
ASSIGNED_BY_NAME Name of the responsible person String
OPENED "Available to everyone" option in the company record: Y — yes, N — no String
TITLE Company name String
ADDRESS_1 Address 1 String
ADDRESS_2 Address 2 String
ADDRESS_CITY City String
ADDRESS_POSTAL_CODE Postal code String
ADDRESS_REGION Region String
ADDRESS_PROVINCE Province String
ADDRESS_COUNTRY Country String
ADDRESS_COUNTRY_CODE Country code String
BANKING_DETAILS Banking details String
COMMENTS Comments String
COMPANY_TYPE_ID Company type ID String
COMPANY_TYPE_NAME Company type name String
COMPANY_TYPE ID and name of the company type String
INDUSTRY_ID Industry ID String
INDUSTRY_NAME Industry name String
INDUSTRY ID and name of the company industry String
REVENUE Annual revenue Number
CURRENCY_ID Currency String
EMPLOYEES Number of employees String
LEAD_ID ID of the lead linked to the company Number
ORIGINATOR_ID ID of the external system where the company was created String
ORIGIN_ID Company ID in the external system String
ORIGIN_VERSION Version of the company data in the external system. Used to track changes and sync data String
IS_MY_COMPANY "My Company" flag: Y — yes, N — no. Marks your own companies String
UTM_SOURCE Ad source, UTM_SOURCE in the company record String
UTM_MEDIUM Advertising medium, UTM_MEDIUM in the company record String
UTM_CAMPAIGN Advertising campaign, UTM_CAMPAIGN in the company record String
UTM_CONTENT Advertising content, UTM_CONTENT in the company record String
UTM_TERM Ad term, UTM_TERM in the company record String
PHONE Phone String
WEB Website URLs linked to the company String
EMAIL Email String
IM Messengers String

crm_company_uf — custom fields for companies. This dataset includes data from the custom fields you created, such as client categories, extra contact details, and other custom fields. You can use this data in a report.

crm_company_uf

Field Description Data type
COMPANY_ID Company ID Number
DATE_CREATE Date and time of creation Date
UF_LOGO Logo String UF_CRM_"field number" Data from the custom field with the specified number, for example UF_CRM_123456789. The number is assigned automatically when the field is created. String
UF_STAMP Company stamp String
UF_DIRECTOR_SIGN Director signature String
UF_ACCOUNTANT_SIGN Accountant signature String

crm_contact — contacts. This dataset includes core data from contact system fields. You can see who created the contact, who is responsible for it, and which company it is linked to.

crm_contact

Field Description Data type
ID Contact ID Number
DATE_CREATE Date and time the contact was created Date
DATE_MODIFY Date and time the contact was last updated Date
CREATED_BY_ID Creator ID Number
CREATED_BY ID and name of the creator String
CREATED_BY_NAME Creator name String
MODIFY_BY_ID ID of the employee who updated the contact record Number
MODIFIED_BY_NAME Name of the employee who updated the contact record String
MODIFIED_BY ID and name of the employee who updated the contact record String
ASSIGNED_BY_ID Responsible person ID Number
ASSIGNED_BY ID and name of the responsible person String
ASSIGNED_BY_NAME Name of the responsible person String
OPENED "Available to everyone" option in the contact record: Y — yes, N — no String
COMPANY_ID Company ID Number
SOURCE_ID Source ID String
SOURCE_DESCRIPTION Source description String
NAME First name String
LAST_NAME Last name String
SECOND_NAME Middle name String
POST Job title String
ADDRESS_1 Address 1 String
ADDRESS_2 Address 2 String
ADDRESS_CITY City String
ADDRESS_POSTAL_CODE Postal code String
ADDRESS_REGION Region String
ADDRESS_PROVINCE Province String
ADDRESS_COUNTRY Country String
ADDRESS_COUNTRY_CODE Country code String
COMMENTS Comments String
LEAD_ID ID of the lead linked to the contact Number
EXPORT Include in export: Y — yes, N — no String
TYPE_ID Type ID, for example CLIENT String
ORIGINATOR_ID ID of the external system where the contact was created String
ORIGIN_ID Contact ID in the external system String
ORIGIN_VERSION Version of the contact data in the external system. Used to track changes and sync data String
BIRTHDATE Date of birth Date
HONORIFIC Salutation code, for example HNR_RU_1 String
FACE_ID Face ID Number
PHONE Phone String
WEB Website URLs linked to the contact String
EMAIL Email String
IM Messengers String
UTM_SOURCE Ad source, UTM_SOURCE in the contact record String
UTM_MEDIUM Advertising medium, UTM_MEDIUM in the contact record String
UTM_CAMPAIGN Advertising campaign, UTM_CAMPAIGN in the contact record String
UTM_CONTENT Advertising content, UTM_CONTENT in the contact record String
UTM_TERM Ad term, UTM_TERM in the contact record String

Contact: custom fields — crm_contact_uf: This dataset stores custom contact fields, such as last contact date or status.

Contact: custom fields — crm_contact_uf

Field Description Field type
CONTACT_ID Contact ID Number
DATE_CREATE Contact creation date and time Date
UF_CRM_"field ID" Custom field value. The field ID is assigned during creation in the format UF_CRM_123456789. String

How to create a chart

Use datasets to visualize data and track performance. Charts help you understand how your team works with companies and contacts.

  1. Go to BI Builder.
  2. Open the Charts tab.
  3. Click + Chart.
  4. Select a dataset.
  5. If you don’t see the dataset you need, click Add a dataset.
  6. Choose a chart type (table, line chart, big number, and more).
  7. Click Create new chart.

How to combine datasets

You can combine datasets to include both standard and custom fields in one report.

  1. Go to SQL > SQL Lab.
  2. Select the bitrix24 schema.
  3. Enter your SQL query and click Run.
  4. Save the result as a dataset.
  5. Use this dataset to build charts.

Create a chart based on a virtual dataset

Example of an SQL query

Here's an SQL query to extract data from two datasets: companies (crm_company) and company custom fields (crm_company_uf). You can copy it and see how it works. Replace UF_CRM_"field ID" with your custom field before running the query.

 SELECT crm_company.TITLE AS "Company name", crm_company.ASSIGNED_BY_NAME AS "Responsible person", crm_company_uf.UF_CRM_1730983962844 AS "Custom field", crm_company.PHONE AS "Company phone number", crm_company.EMAIL AS "Company email address", crm_company.WEB AS "Company website" FROM crm_company INNER JOIN crm_company_uf ON crm_company.ID = crm_company_uf.COMPANY_ID WHERE crm_company_uf.UF_CRM_1730983962844 IS NOT NULL AND crm_company_uf.UF_CRM_1730983962844 <> '' 

SELECT: Chooses which data to extract. For example, the SELECT crm_company.TITLE AS "Company name" part does the following:

  • Selects the company name TITLE from the crm_company dataset
  • Assigns it the name Company name
  • Displays the result in a separate column

FROM: Specifies the main table for the query, such as the crm_company table containing company information.

INNER JOIN: Connects datasets and bends information in them. The query crm_company_uf ON crm_company.ID = crm_company_uf.COMPANY_ID connects two datasets by company ID.

WHERE: Filters the query results to show the rows where the custom field is not empty.


In brief

    • Datasets store CRM data for leads, deals, companies, and contacts
    • Each item includes datasets with standard and custom fields
    • Main datasets: crm_company, crm_company_uf, crm_contact, crm_contact_uf
    • Use datasets to build charts and track performance
    • Use SQL to combine datasets and include custom fields in reports
Go to Bitrix24
Don't have an account? Create for free