A dataset contains information about employees, company structure, calls, and other Bitrix24 items. Each item has several datasets that automatically receive data from system and custom fields. Use datasets to create charts and analyze business metrics.
In this article, you'll learn about datasets for employees, company structure, calls, and Open Channels, how to merge them, and how to create charts.
Datasets:
- user — employees
- org_structure — company structure
- org_structure_relation — department structure
- telephony_call — calls
- imopenlines_session — Open Channel conversations
Examples:
Choose a dataset
To analyze information in a dashboard, choose a suitable dataset and create a chart.
user — employees. This dataset contains employee information, including their status, department, and position in the company structure. Use it to count employees and analyze how the company is organized.
user
| Field | Description | Data type |
|---|---|---|
| ID | User ID | Number |
| ACTIVE | Shows whether the user is employed: Y — yes, N — no |
String |
| NAME | User name | String |
| DEPARTMENT | Path in the department hierarchy in the format [ID] Name; starts with the company name; path items are separated by / |
String |
| DEPARTMENT_IDS | IDs of all departments the employee is in | String |
| DEPARTMENT_ID | Main department ID | String |
| DEPARTMENT_NAME | Main department name | String |
| DEPARTMENT_ID_NAME | Main department ID and name | String |
| DEP1 | Name of the first level department in the structure | String |
| DEP2 | Name of the second level department in the structure | String |
| DEP3 | Name of the third level department in the structure | String |
| DEP1_ID | ID of the first level department in the structure | String |
| DEP2_ID | ID of the second level department in the structure | String |
| DEP3_ID | ID of the third level department in the structure | String |
| DEP1_N | ID and name of the first level department in the structure | String |
| DEP2_N | ID and name of the second level department in the structure | String |
| DEP3_N | ID and name of the third level department in the structure | String |
org_structure — company structure. This dataset contains information about departments, the company itself, cross-functional teams, their status, and supervisors. Use it to identify active and inactive departments, see who manages them, and track changes to the company structure.
org_structure
| Field | Description | Data type |
|---|---|---|
| ID | Company structure item ID | Number |
| ACTIVE | Shows whether the structure item is active: Y — yes, N — no |
String |
| NAME | Company structure item name | String |
| ID_NAME | Company structure item ID and name | String |
| TYPE | Structure item type: DEPARTMENT — department, COMPANY — company, TEAM — cross-functional team |
String |
| PARENT_ID | Parent structure item ID | Number |
| ID_PARENT_NAME | Parent structure item ID and name | String |
| HEAD_ID | Department supervisors' IDs | String |
org_structure_relation — department structure. This dataset shows how departments are connected within the company structure. Use it to understand the relationships between departments.
org_structure_relation
| Field | Description | Data type |
|---|---|---|
| ID | Department link ID | Number |
| PARENT_ID | Parent department ID | Number |
| CHILD_ID | Child department ID | Number |
| DEPTH | Nesting level of the child department relative to the parent | Number |
| PARENT_NODE_NAME | Parent department name | String |
| PARENT_NODE | Parent department ID and name | String |
| CHILD_NODE_NAME | Child department name | String |
| CHILD_NODE | Child department ID and name | String |
telephony_call — calls. This dataset contains call details, including agents, customer phone numbers, call types, statuses, duration, costs, recordings, transcripts, and linked CRM items. Use it to analyze call duration and see which customers, deals, and leads are associated with each call.
telephony_call
| Field | Description | Data type |
|---|---|---|
| CALL_ID | Call ID | String |
| PORTAL_USER_ID | Agent ID | Number |
| PORTAL_USER | Agent ID and name | String |
| PORTAL_USER_DEPARTMENT | Agent department hierarchy path | String |
| PORTAL_NUMBER | Agent extension number | String |
| PHONE_NUMBER | Callee phone number | String |
| CALL_TYPE | Call type code: 1 — "Outgoing", 2 — "Incoming", 3 — "Incoming with redirect", 4 — "Callback" | Number |
| CALL_DURATION | Call duration, sec | Number |
| RECORD_DURATION | Talk duration, sec | Number |
| CALL_START_TIME | Call start date and time | Date and time |
| CALL_STATUS_CODE | Call result code and name | String |
| CALL_STATUS_CODE_ID | Call result code | String |
| CALL_STATUS_CODE_NAME | Call result name | String |
| CALL_STATUS_REASON | Call result text description | String |
| RECORD_FILE_ID | Call recording file ID | Number |
| CALL_VOTE | Call rating (available only for internal calls) | Number |
| COST | Call cost | Number |
| COST_CURRENCY | Call currency | String |
| CRM_ENTITY_TYPE | Type code of the CRM item linked to the call activity | String |
| CRM_ENTITY_ID | ID of the CRM item linked to the call activity | Number |
| CRM_ACTIVITY_ID | ID of the CRM activity created from the call | Number |
| REST_APP_ID | External telephony integration application ID | Number |
| REST_APP_NAME | External telephony integration application name | String |
| TRANSCRIPT_PENDING | Shows whether the call transcript will be received later: Y — yes, N — no |
String |
| TRANSCRIPT_ID | Call transcript ID | Number |
| REDIAL_ATTEMPT | Number of dial attempts | Number |
| COMMENT | Call comment | String |
imopenlines_session — Open Channel conversations. This dataset contains conversation details, including inquiry sources, channels, customers, agents, statuses, response times, duration, and customer ratings. Use it to analyze agent workload, first response times, and how well agents handle customer inquiries.
imopenlines_session
| Field | Description | Data type |
|---|---|---|
| ID | Open Channel conversation ID | Number |
| MODE | Conversation type: "Inbound" or "Outbound" | String |
| STATUS | Conversation status: "New", "Enqueued", "In progress", "Client is waiting for a response", "Client is waiting (again)", "Agent replied", "Waiting to close", "Closed", "Spam", "Duplicate", or "Closed without notification" | String |
| SPAM | Shows whether the conversation is marked as spam: Y — yes, N — no |
String |
| SOURCE | Inquiry source, such as Live chat or Facebook | String |
| CONFIG_ID | Open Channel ID | Number |
| CONFIG_NAME | Open Channel name | String |
| CONFIG | Open Channel ID and name | String |
| CLIENT_ID | Customer ID | Number |
| CLIENT_NAME | Customer name | String |
| CLIENT | Customer ID and name | String |
| OPERATOR_ID | Agent ID | Number |
| OPERATOR_NAME | Agent name | String |
| OPERATOR | Agent ID and name | String |
| DATE_CREATE | Date and time when the conversation was created | Date and time |
| DATE_OPERATOR_ANSWER | Date and time of the agent's first response | Date and time |
| DATE_OPERATOR_CLOSE | Date and time when the agent closed the conversation | Date and time |
| WAIT_ANSWER | Shows whether the conversation is waiting for an agent's response: Y — yes, N — no |
String |
| TIME_ANSWER | Time from conversation creation until the agent starts working on it, in seconds | Number |
| TIME_CLOSE | Time from conversation creation until the agent closes it, in seconds | Number |
| TIME_DIALOG | Total conversation duration, in seconds | Number |
| VOTE | Client rating: 5 — positive, 1 — negative, 0 — no rating | Number |
| TIME_FIRST_ANSWER | Time until the first response, in seconds | Number |
| DATE_LAST_MESSAGE | Date and time of the last message in the conversation | Date and time |
| DATE_CLOSE | Date and time when the conversation was finally closed | Date and time |
Create a chart
Add information from a dataset to charts and track incoming and outgoing calls per employee. Charts show call activity and average talk duration.
- Open BI Builder > Charts.
- Click + Chart in the top-right corner.
- Choose a dataset from the list. If you do not see the dataset you need, click Add a dataset.
Create a dataset - Choose a chart type — the format for viewing the information, such as a card, table, line chart, or another option.
- Click Create new chart.
Merge datasets
Merge call and employee data to see who called, which department they are from, and how long the call lasted.
- Open BI Builder > SQL > SQL Lab.
- Make sure
bitrix24is selected in the Schema field. - Enter the SQL query and click Run.
- Review the query results. To create a chart for a report, save the query as a dataset. The dataset receives data from the fields specified in the SQL query.
Create a chart from a virtual dataset
If this is your first time merging datasets, see the sample query.
Example SQL query
This SQL query extracts data from two datasets: employees (user) and calls (telephony_call). You can copy it to see how the query works. The query shows an employee's calls: name, main department, and each call duration. Replace the employee ID before running the query.
SELECT
NAME AS "User name",
DEPARTMENT_NAME AS "Department name",
CALL_DURATION AS "Call duration (sec)"
FROM telephony_call
LEFT JOIN user
ON user.ID = telephony_call.PORTAL_USER_ID
WHERE PORTAL_USER_ID = 310;
SELECT determines which information to extract from the dataset. For example, SELECT NAME AS "User name":
- Selects the employee name
NAMEfrom theuserdataset - Names it
User name - Shows the result as a separate column in the table
FROM specifies the main dataset the data comes from. Here it is telephony_call, the table with call information.
LEFT JOIN connects the telephony_call table with user. The query links calls to employee data.
WHERE filters the results and shows calls for a specific employee. The condition PORTAL_USER_ID = 310 keeps calls made by that employee. To see calls for all employees, remove the WHERE condition.
In brief
- A dataset contains information about employees, company structure, calls, and other Bitrix24 items.
- Each item has several datasets that automatically receive data from system and custom fields.
- There are five datasets for employees, company structure, calls, and Open Channels: employees (user), company structure (org_structure), department structure (org_structure_relation), calls (telephony_call), and Open Channel conversations (imopenlines_session).
- Use datasets to create charts and analyze metrics, such as employee count, department distribution, call volume, and average talk duration.
- Merge datasets to see which employees call and reply to customers, which channels inquiries come from, and how long clients wait for a reply. Write an SQL query, save the result as a dataset, and create a chart.