Datasets contain information on leads, deals, companies, and other items. Each item has multiple datasets that automatically include both standard and custom fields. Use these datasets to create charts and analyze business performance indicators.
In this article, we'll explore datasets for activities, CRM stages, and CRM item links. Learn how to blend them and how to create charts.
Datasets:
Examples:
Datasets
To start analyzing data on a dashboard, select a dataset and create a chart based on it.
Activity — crm_activity: Contains details about activities in CRM items. You can find out which activities are linked to your deals, contacts, or companies, along with their types, deadlines, and responsible users.
Activity — crm_activity
Field | Description | Field type |
---|---|---|
ID | Unique key | Number |
SUBJECT | Activity name (e.g., Contact customer) | String |
ASSOCIATED_ENTITY_ID | ID of the Bitrix24 entity associated with the activity. | Number |
TYPE_ID | Activity type ID: 2 (call), 4 (email), 6 (user action). Values 1 (meeting) and 3 (task) are outdated. Now, the system uses 6 (user action) instead. | Number |
PROVIDER_ID | Specifies the activity type in CRM. For example, a CRM form is marked as CRM_WEBFORM. | String |
PROVIDER_TYPE_ID | Specifies the activity category in CRM. For example, for a CRM form, it shows the form ID. | String |
TYPE_NAME | Activity type name, like "Meeting" or "Call" | String |
OWNER_ID | ID of the CRM entity to which the activity is linked | Number |
OWNER_TYPE_ID | CRM entity type code: 1 - lead, 2 - deal, 3 - contact | Number |
OWNER_TYPE_NAME | CRM entity type name | String |
PRIORITY_ID | Priority code: 1 - low, 2 - normal, 3 - high | Number |
PRIORITY_NAME | Priority level | String |
DIRECTION_ID | Pipeline ID | Number |
DIRECTION_NAME | Pipeline name | String |
STATUS_ID | Status code: 1 - pending, 2 - completed, 3 - completed automatically | Number |
STATUS_NAME | Status name | String |
COMPLETED | Shows whether the activity is completed ("Y") or not ("N") | String |
DATE_CREATE | Activity creation date and time | Date |
START_TIME | Activity start time | Date |
END_TIME | Activity completion time | Date |
DEADLINE | Activity deadline | Date |
DATE_MODIFY | Last change date and time | Date |
AUTHOR | ID and name of the user who created the activity | String |
AUTHOR_ID | ID of the user who created the activity | Number |
AUTHOR_NAME | Name of the user who created the activity | String |
EDITOR | ID and name of the user who last modified the activity | String |
EDITOR_ID | ID of the user who last modified the activity | Number |
EDITOR_NAME | Name of the user who last modified the activity | String |
RESPONSIBLE | Activity responsible person name and ID | String |
RESPONSIBLE_ID | Activity responsible person ID | Number |
RESPONSIBLE_NAME | Activity responsible person name | String |
DESCRIPTION | Activity description | String |
DESCRIPTION_TYPE_ID | Description type code | Number |
DESCRIPTION_TYPE_NAME | Description type | String |
ORIGINATOR_ID | External system where the activity was created | String |
ORIGIN_ID | Activity external ID | String |
Some activities are marked as user actions, such as tasks (type_id=6). To specify the activity type, use the PROVIDER_ID and PROVIDER_TYPE_ID fields. They allow you to see the category for a specific activity in CRM.
PROVIDER_ID and PROVIDER_TYPE_ID values
Field | PROVIDER_ID | PROVIDER_TYPE_ID |
---|---|---|
Call list | CALL_LIST | CALL_LIST |
App activity (added using REST API) | CONFIGURATION_REST_APP | CONFIGURABLE by default, can be any subtype registered via REST.
Methods for handling a configurable activity Method for registering an activity subtype |
Open slots | CRM_CALENDAR_SHARING | CALENDAR_SHARING |
Delivery | CRM_DELIVERY | DELIVERY |
Document for signing | CRM_SIGN_DOCUMENT | SIGN_DOCUMENT |
CRM_EMAIL | EMAIL or EMAIL_COMPRESSED | |
App activity (added using REST API) | CRM_EXTERNAL_CHANNEL | ACTIVITY (old version)
External Channels |
Meeting | CRM_MEETING | MEETING (old version) |
WhatsApp message | CRM_NOTIFICATION | NOTIFICATION (all messages, except the ones from Sales center), SALESCENTER_PAYMENT_SENT (messages from Sales center) |
Payment | CRM_PAYMENT | PAYMENT |
Workflow assignment | CRM_REQUEST | REQUEST |
SMS message | CRM_SMS | SMS |
Task | TASKS | TASK |
Task (new version) | CRM_TASKS_TASK | TASKS_TASK |
Task comments | CRM_TASKS_TASK_COMMENT | TASKS_TASK_COMMENT |
Activity | CRM_TODO | TODO |
Submitted CRM form | CRM_WEBFORM | ID of the submitted form |
Open Channel chat | IMOPENLINES_SESSION | ID of the open channel conversation |
App activity (added using REST API) | REST_APP | Any subtype registered via REST.
Method for registering an activity subtype |
Inventory document | STORE_DOCUMENT | STORE_DOCUMENT_PRODUCT or STORE_DOCUMENT_SERVICE |
Visit | VISIT_TRACKER | VISIT |
Call | VOXIMPLANT_CALL | CALL |
Zoom meeting | ZOOM | ZOOM_CONF_START |
CRM stages — crm_stages: Includes information about the stages of CRM items. You can learn about the current stages of deals or SPAs, including their names and order.
CRM stages — crm_stages
Field | Description | Field type |
---|---|---|
ID | Record ID | Number |
ENTITY_TYPE_ID | Entity type ID | Number |
STATUS_ID | Stage ID | String |
NAME | Stage name | String |
CATEGORY_ID | Pipeline ID | Number |
CATEGORY_NAME | Pipeline name | String |
SORT | Sort order | Number |
SEMANTICS | Stage type: "null" for intermediate stages, "S" for success, and "F" for failure. | String |
CRM item links — crm_entity_relation: Provides information about the connections between CRM items. You can see how deals are linked to contacts or companies and how CRM items interact with each other.
CRM item links — crm_entity_relation
Field | Description | Field type |
---|---|---|
SRC_ENTITY_TYPE_ID | Source entity type ID (e.g., Lead 1, Deal 2, Contact 3, Company 4, Invoice 31, Estimate 7, Details 8) | Number |
SRC_ENTITY_ID | Source entity ID | Number |
SRC_ENTITY_DATASET_NAME | Source entity dataset name | String |
DST_ENTITY_TYPE_ID | Linked entity type ID (e.g., Lead 1, Deal 2, Contact 3, Company 4, Invoice 31, Estimate 7, Details 8) | Number |
DST_ENTITY_ID | Linked entity ID | Number |
DST_ENTITY_DATASET_NAME | Linked entity dataset name | String |
How to create a chart
Use datasets to create charts and check business performance. Charts can show the trends in completed activities, progress across various deal stages, and the links between CRM items.
Go to the BI Builder and follow these steps:
- Open the Charts tab.
- Click + Chart.
- Select the dataset from the list. If you don't see the one you need, click Add a dataset to create a new one.
How to create a dataset - Choose a format for showing the data: big number, table, line chart, or others.
- Click Create new chart.
How to blend datasets
Combine datasets to identify which activities are linked to deals in your report.
Go to the BI Builder and do the following:
- Go to SQL > SQL Lab.
- Select the bitrix24 scheme.
- Enter the SQL query and click Run.
The new set includes information from the fields that you specified in the SQL query. You can save it as a dataset to create a chart for the dashboard.
Create a chart based on a virtual dataset
If you're blending datasets for the first time, refer to the sample query.
Example of an SQL query
Here's an SQL query to extract data from two datasets: deals (crm_deal) and activities (crm_activity). You can copy it and see how it works.
The query selects a specific deal with ID 225, displaying its details, the responsible user, and a list of linked activities. Replace the deal ID with the needed one before running the query.
SELECT crm_deal.ID AS "Deal ID", crm_deal.TITLE AS "Deal name", crm_deal.ASSIGNED_BY AS "Responsible user", crm_activity.ID AS "Activity ID", crm_activity.SUBJECT AS "Activity name", crm_activity.DEADLINE AS "Activity deadline" FROM crm_deal LEFT JOIN crm_activity ON crm_activity.OWNER_ID = crm_deal.ID AND crm_activity.OWNER_TYPE_ID = '2' WHERE crm_deal.ID = 225;
SELECT: Chooses which data to extract. For example, the SELECT crm_deal query.ID AS "Deal ID"
part does the following:
- Selects the deal
ID
from thecrm_deal
dataset - Assigns it the name
Deal ID
- Displays the result in a separate column
FROM: Specifies the main table for the query, such as the crm_deal
table containing information about deals.
LEFT JOIN: Connects the crm_deal
table to crm_activity
. The query connects deals to their activities. Use LEFT JOIN to ensure no deals are missed, even if they don't have linked activities.
WHERE: Filters the query results to show only a specific deal and its activities. To get data for a different deal, replace 225
with the desired ID. To see all deals and their activities, remove the WHERE condition.
In brief
-
Datasets contain information on leads, deals, companies, and other items.
-
Each item has multiple datasets that automatically include both standard and custom fields.
-
There are three datasets for activities, CRM stages, and CRM item links: activities (crm_activity), CRM stages (crm_stages), and CRM item links (crm_entity_relation).
-
Use these datasets to create charts and analyze business performance indicators. Charts can show the trends in completed activities, progress across various deal stages, and the links between CRM items.
-
Blend datasets identify which activities are linked to deals in your report. To do this, write an SQL query, save the result as a dataset, and create a chart.