Bitrix24: direct connection
Note
In this tutorial all objects will be created and stored in a workbook. If using legacy folder navigation, create an individual directory to work in.
Create a directory
- Go to the DataLens home page
. - In the left-hand panel, select
All objects or Personal directory. - In the top-right corner, click Create → Directory.
- Enter a name for the directory.
- Click Create.
In this tutorial, you will create a connection to a demo Bitrix24 data source and explore the dashboard and charts built by Bitrix24 with DataLens. You will also learn to work with datasets, charts, and dashboards.
To visualize and explore data, set up DataLens and follow the steps below:
- Create a workbook.
- Create a connection to Bitrix24.
- Review the dashboard and charts.
- Review the dataset. Create your dataset and chart.
Getting started
To get started with DataLens:
- Log in
to your Yandex account. If you do not have an account, create one. - Open the DataLens home page
. - Click Open DataLens.
- Confirm that you have read the Terms of use
and click Log in.
-
Log in
to your Yandex account. -
Open the DataLens home page
. -
Click Open DataLens.
-
Select one of the options:
-
If you already have an organization, select it from the drop-down menu in the Organizations tab and click DataLens.
Note
To activate a DataLens instance, the user must have the
admin
orowner
role. For more information about roles, see Access management in Yandex Cloud Organization. -
If you have a cloud but no organization, click Add new DataLens. In the window that opens, enter your organization's name and description and click Create organization and DataLens. For more information about working with organizations, see Getting started with organizations.
-
If you have any technical questions about the service, contact Yandex Cloud support
Create a workbook
- Go to the DataLens home page
. - In the left-hand panel, select
Collections and workbooks. - In the top-right corner, click Create → Create workbook.
- Enter a name for the workbook,
Bitrix24
. - Click Create.
Create a connection to Bitrix24
-
In the top-right corner of the workbook, click Create →
Connection. -
Under Partner connections, select the Bitrix24 connection.
-
To connect to a demo data source, specify:
- Portal:
gds.office.bitrix.ru
. - Token:
wJZIFjdYtbLRtfewYcnq71oSFyEgxlbQ
.
When connecting to a working Bitrix24 data source, specify:
- Portal: URL of your Bitrix24 portal in
test.bitrix24.ru
format. - Token: Get a secret key in Bitrix24 by selecting CRM → Analytics → BI analytics in the Yandex DataLens tab. For more information, see this guide
.
Leave the Automatically create a dashboard, charts, and a dataset on the connection option enabled.
- Portal:
-
Check the connection and click Create connection.
-
Enter a name for the connection, e.g.,
Bitrix24
, and click Create.Once the connection is created, a workbook named
Bitrix24
will open with the demoBitrix24 dashboard
,Leads
andDeals
datasets, and charts inside.
Review the dashboard
Open the Bitrix24 dashboard
. The dashboard is interactive. You can:
- Set up a variety of filters.
- Sort rows in tables.
- Switch between charts.
- Drill down into charts.
Set the filter by creation date, 20.09.2020 - 20.09.2022
, to display the statistics for the selected period.
You can customize the standard dashboard by deleting, moving, or editing charts. In the Leads
tab, change the Dynamics in the number of leads by creation date
chart and add it to the dashboard:
-
Click
in the top-right corner of the chart and select Edit. -
Select Column chart as the chart type.
-
Under Colors, replace status types with the source. To do this, drag the
Source
field from Dimensions to the Colors section and hold it over theStatus type
field until the latter turns red.The chart shows the number of generated leads across channels by month.
-
Save the chart as a new object:
-
Click
in the top-right corner and select Save as copy.Tip
To replace the source chart with the edited one on the dashboard, click Save in the top-right corner.
-
Enter
Number of leads by channel
as the new chart name and click Save.
-
-
Add the chart to the dashboard:
-
Return to the tab with the dashboard and click Edit at the top of the page.
-
In the panel at the bottom of the page, select Chart.
-
In the window that opens, click Select.
-
Select the
Number of leads by channel
chart. This will automatically fill in the Name field. -
Click Add. The widget will be displayed on the dashboard.
-
Adjust the size of the widgets with your mouse and place them on the dashboard as you prefer.
-
In the top-right corner of the dashboard, click Save to save your dashboard.
-
Review the connection and dataset. Create your dataset and chart
-
Go to the
Bitrix24
workbook by clicking its name in the dashboard path. -
Open the
Leads
dataset.The Fields tab displays a list of fields from the table selected in the source. Pay attention to the following columns:
- Name: Field name.
- Type: Field data type.
- Field source: Field in the source table or a formula for calculations (marked with the
icon). - Aggregation: Data aggregation function if it is applied to the field.
Viewing the Fields tab
The Source tab shows the following:
- Connection the dataset is based on.
- List of tables available in the source.
- Workspace for the tables selected as the source of dataset fields.
- Preview area for information from the selected tables.
Viewing the Sources tab
-
Go to the
Bitrix24
workbook and open theDeal
dataset. Review the contents of the Fields and Sources tabs.
Create your dataset
To use the Bitrix24
connection data, you can create a custom dataset based on it:
-
In the left-hand panel, select
Collections and workbooks and go to theBitrix24
workbook. -
In the top-right corner, click Create →
Create dataset. -
Go to the Sources tab.
-
Under Connections, click
** Add** and select the previously created Bitrix24 connection. -
Drag the
crm_activity
table to the workspace. Wait for the data to load. -
Go to the Fields tab.
-
Create a record count field named
ID_COUNT
:-
Duplicate the
ID
field: on the right side of the row with the field, click and select Duplicate. -
Rename the
ID (1)
duplicate field toID_COUNT
: click the row name, delete the current name, and enter the new one. -
In the Aggregation column, select Count for the
ID_COUNT
field. As a result, the field will become a measure and change its color to blue.
Note
You can add and rename fields, create calculated fields, and add descriptions to them.
-
-
Save the dataset:
- In the top-right corner, click Save.
- Enter
Activities
for the dataset name and click Create.
Create a new chart
To visualize interaction by type, create a column chart.
-
Click Create chart in the top-right corner of the dataset page.
-
Add the types of customer contacts on the chart. To do this, drag the
TYPE_NAME
field from Dimensions to the X section. -
Add the number of interactions of each type to the chart. To do this, drag the
ID_COUNT
field from Measures to the Y section. -
Save the chart:
- Click
in the top-right corner and select Save. - Enter
Number of interactions by type
as the new chart's name and click Save.
- Click
Add a chart to your dashboard
Add the chart to your dashboard:
- Go to the
Bitrix24
workbook and openBitrix24 dashboard
or create a dashboard. - At the top of the page, click Edit.
- Click Add and select Chart.
- Choose the
Number of interactions by type
chart. - Click Add. The widget will be displayed on the dashboard.
- Adjust the size of the widgets with your mouse and place them on the dashboard as you prefer.
- Click Save to save your changes to the dashboard.