Bitrix24Care

BI Builder datasets: Smart Process Automation

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 Smart Process Automation, 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.

SPA: items — crm_dynamic_items_"type ID": Includes basic information from both standard and custom fields of the SPA. Discover how many items were created in a month and which employees worked with them.

Each SPA is a separate dataset with its own fields and columns. You need to find the SPA type ID to use its data in reports. The ID is automatically assigned during SPA creation in the format crm_dynamic_items_1032.
Where to find the SPA type ID

SPA: items — crm_dynamic_items_"type ID"

Field Description
ID Unique key
XML_ID External ID
TITLE SPA name
CREATED_BY ID and name of the user who created the SPA item
CREATED_BY_ID ID of the user who created the SPA item
CREATED_BY_NAME Name of the user who created the SPA item
UPDATED_BY ID and name of the user who last updated the SPA item
UPDATED_BY_ID ID of the user who last updated the SPA item
UPDATED_BY_NAME Name of the user who last updated the SPA item
MOVED_BY ID and name of the user who changed the stage
MOVED_BY_ID ID of the user who changed the stage
MOVED_BY_NAME Name of the user who changed the stage
CREATED_TIME SPA item creation date
UPDATED_TIME SPA item change date
MOVED_TIME SPA item's stage change date
CATEGORY Pipeline name and ID
CATEGORY_ID Pipeline ID
CATEGORY_NAME Pipeline name
OPENED Shows whether the deal is available to all employees ("Y") or not ("N")
STAGE Stage name and ID
STAGE_ID Stage ID
STAGE_NAME Stage name
PREVIOUS_STAGE_ID Previous stage ID
BEGINDATE Start date
CLOSEDATE End date
COMPANY Company name and ID
COMPANY_ID Company ID
COMPANY_NAME Company name
CONTACT Contact name and ID
CONTACT_ID Contact ID
CONTACT_NAME Contact name
OPPORTUNITY Expected amount
IS_MANUAL_OPPORTUNITY Shows whether the expected amount was entered manually ("Y") or not ("N")
TAX_VALUE Tax
CURRENCY_ID Currency
OPPORTUNITY_ACCOUNT Amount in reporting currency
TAX_VALUE_ACCOUNT Tax in reporting currency
ACCOUNT_CURRENCY_ID Reporting currency
MYCOMPANY ID and name of my company
MYCOMPANY_ID My company ID
MYCOMPANY_NAME My company name
SOURCE Source name and ID (e.g., "[STORE] Online store")
SOURCE_ID Source ID
SOURCE_NAME Source name
SOURCE_DESCRIPTION Source description
ASSIGNED_BY ID and name of the user assigned as a responsible person
ASSIGNED_BY_ID ID of the user assigned as a responsible person
ASSIGNED_BY_NAME Name of the user assigned as a responsible person
WEBFORM_ID ID of the source CRM form
UF_CRM_"field ID" Custom field value. The field ID is assigned during creation in the format UF_CRM_123456789.

SPA: products — crm_dynamic_items_prod_"type ID": Contains details about the products, including their names, quantities, and prices in the selected SPA items.

To use the linked product data in reports, find the SPA type ID. For example, if you have an SPA called "Orders" with type ID 105, this ID will appear in the product dataset name as crm_dynamic_items_prod_105.
Where to find the SPA type ID

SPA: products — crm_dynamic_items_prod_"type ID"

Field Description
ID Unique key
ITEM_ID SPA item ID
PRODUCT Product
PRODUCT_ID Product ID
PRODUCT_NAME Product name
PRICE Product price
PRICE_EXCLUSIVE Discounted price without tax
PRICE_NETTO Price without discount or tax
PRICE_BRUTTO Price with tax, but without discount
QUANTITY Product quantity
DISCOUNT_TYPE Discount name and ID
DISCOUNT_TYPE_ID Discount ID
DISCOUNT_TYPE_NAME Discount name
DISCOUNT_RATE Discount percentage value
DISCOUNT_SUM Discount amount
TAX_RATE Tax percentage rate
TAX_INCLUDED Shows whether tax is included in price ("Y") or not ("N")
CUSTOMIZED Shows whether the product was modified manually after being added to the SPA item ("Y") or not ("N")
MEASURE Unit of measurement
MEASURE_CODE Unit of measurement ID
MEASURE_NAME Unit of measurement name
SORT Sorting order
PARENT Product section
SUPERPARENT Parent product section
SUPERSUPERPARENT Parent of parent product section

Automated solution — crm_automated_solution_"automated solution ID": Provides information about the automated solution and linked SPAs, including their names and IDs.

To find the automated solution ID, go to Automation > Automated solutions > Automated solutions and check the ID column.
Automated solutions: automate work of company departments

Automated solution — crm_automated_solution_"automated solution ID"

Field Description Field type
ENTITY_TYPE_ID SPA type ID Number
TITLE SPA name String
DATASET_NAME SPA dataset name String
AUTOMATED_SOLUTION_DATASET_NAME Automated solution dataset name String
CUSTOM_SECTION_ID Automated solution ID Number
CUSTOM_SECTION_TITLE Automated solution name String

Smart Process Automation — crm_smart_proc: Includes a list of all SPAs and automated solutions, along with their IDs and names.

Smart Process Automation — crm_smart_proc

Field Description Field type
ENTITY_TYPE_ID SPA type ID Number
TITLE SPA name String
DATASET_NAME SPA dataset name String
AUTOMATED_SOLUTION_DATASET_NAME Automated solution dataset name; if the SPA is not linked to any automated solution, the CRM dataset name will be displayed String
CUSTOM_SECTION_ID Automated solution ID Number
CUSTOM_SECTION_TITLE Automated solution name String

How to create a chart

Use datasets to create charts and check business performance. For example, evaluate sales volume or which products are selling more often.

Go to the BI Builder and follow these steps:

  1. Open the Charts tab.
  2. Click + Chart.
  3. 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
  4. Choose a format for showing the data: big number, table, line chart, or others.
  5. Click Create new chart.

How to blend datasets

Combine datasets to identify which products are used in SPA items in your report.

Go to the BI Builder and do the following:

  1. Go to SQL > SQL Lab.
  2. Select the bitrix24 scheme.
  3. 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 four datasets:

  • SPA items (crm_dynamic_items_1052)
  • SPA products (crm_dynamic_items_prod_1052)
  • Product properties (crm_product_property)
  • Product property values (crm_product_property_value)

The query selects SPA items that have products with "coat" in their names and displays their properties by color. You can copy it and see how it works. Before running the query, replace crm_dynamic_items_"type ID" and crm_dynamic_items_prod_"type ID" with your SPA.

SELECT 
    crm_dynamic_items_1052.ID AS "SPA item ID",
    crm_dynamic_items_1052.TITLE AS "SPA item name",
    crm_dynamic_items_prod_1052.PRODUCT_ID AS "Product ID",
    crm_dynamic_items_prod_1052.PRODUCT_NAME AS "Product name",
    crm_dynamic_items_prod_1052.PRICE AS "Product price",
    crm_product_property.NAME AS "Property name",
    crm_product_property_value.VALUE AS "Property value"
FROM
    crm_dynamic_items_1052
LEFT JOIN 
    crm_dynamic_items_prod_1052 ON crm_dynamic_items_prod_1052.ITEM_ID = crm_dynamic_items_1052.ID
LEFT JOIN 
    crm_product_property_value ON crm_product_property_value.PRODUCT_ID = crm_dynamic_items_prod_1052.PRODUCT_ID
LEFT JOIN 
    crm_product_property ON crm_product_property.ID = crm_product_property_value.PROPERTY_ID
WHERE 
    crm_dynamic_items_prod_1052.PRODUCT_NAME LIKE '%coat%'
    AND crm_product_property.NAME = 'Color';

SELECT: Chooses which data to extract. For example, the SELECT crm_dynamic_items_1052.ID AS "SPA item ID" part does the following:

  • Selects the SPA item ID from the crm_dynamic_items_1052 dataset
  • Assigns it the name SPA item ID
  • Displays the result in a separate column

FROM: Specifies the main table for the query, such as the crm_dynamic_items_1052 table containing information on the SPA items.

LEFT JOIN: Connects crm_dynamic_items_1036 to crm_dynamic_items_prod_1052 by the SPA item ID. The query connects each SPA item with its products. Use LEFT JOIN to ensure no SPA items are missed, even if they don't have linked products or properties.

LEFT JOIN: Connects crm_dynamic_items_prod_1052 to crm_product_property_value by product ID. The query connects each product with property values.

LEFT JOIN: Connects the crm_product_property_value table to crm_product_property by the product property ID. The query connects the property values with their names.

WHERE: Filters the query results to show only the SPA items that have products with "coat" in their names, showing their properties by color. You can delete or change the filters in the query. For example, in the condition crm_dynamic_items_prod_1052.PRODUCT_NAME LIKE '%coat%', you can replace "coat" to search for different products.


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 four datasets for Smart Process Automation: SPA items (crm_dynamic_items_*), SPA products (crm_dynamic_items_prod_*), automated solutions (crm_automated_solution_*), and Smart Process Automation (crm_smart_proc).

  • Use these datasets to create charts and analyze business performance indicators.

  • Blend datasets to identify which products are used in SPA items in your report. To do this, write an SQL query, save the result as a dataset, and create a chart.

Was this information helpful?
Integration specialist assistance
That's not what I'm looking for
Complicated and incomprehensible text
The information is outdated
It's too short. I need more information
I don't like the way this tool works
Go to Bitrix24
Don't have an account? Create for free
Related articles
BI Builder datasets: activities, CRM stages, and CRM item links BI Builder datasets: products BI Builder datasets: deals BI Builder datasets: leads