Integration & Automation-obtain enterprise group chat statistics
Note:
This function can only be foundBefore the current dateThe data.
For example, today is December 1, 2021. this function can only query data before December 1.
1. Usage scenarios
The built-in data catalog connector YIDA allows you to obtain statistics on group chats during instant communication. Include:
- Group chat users: refers to the number of users who send group chat messages in the enterprise.
- Number of new groups: refersThe number of new groups in the enterprise.
- Number of active groups: refersThe number of internal groups in the enterprise with group chat messages.
- Group chat messages: refersThe number of messages in the enterprise internal group.
- Number of internal groups: refersThe number of internal groups in the enterprise.
- Number of department groups: refersThe number of department groups that exist.
2. Procedure
2.1 Step 1: form design
Create two forms to trigger the connector and receive and display the data returned by the connector.
2.1.1 create the query enterprise group chat statistics form
Procedure:
- Create a common form named query enterprise group chat statistics 」.
- The add date component is named query date and set to required. (The operation is shown in Figure 2.1-1)
Figure 2.1-1 add and configure date components
- Click save in the upper-right corner of the page.
2.1.2 create the enterprise group chat data details form
Procedure:
- Create a common form named Enterprise group chat data details 」.
- Add a multi-line text component named return data and set the status to hidden 」. (The operation is shown in Figure 2.1-2)
Figure 2.1-2 add and configure multi-line text components
- Add a subform component named Enterprise group chat statistics list and set the status to read-only 」. (The operation is shown in Figure 2.1-3)
Figure 2.1-3 add and configure subform components
- Add the following code to the JS panel for data processing. (The operation is shown in Figure 2.1-5)
Figure 2.1-5 add JS code for data processing
The preceding code is as follows and can be copied directly.Pay attention to replacing the unique identifier of the component, otherwise the expected effect will not be achieved!
export function didMount() {
// 获取连接器返回数据,其中「textareaField_ky16z248」为多行文本组件唯一标识,请注意替换,否则会失效哦!!!
const str = this.$("textareaField_ky16z248").getValue();
//进行数据处理
const obj = JSON.parse(str);
const val = obj.dataList;
let arr = [];
const valList = val.map(item => {
let valObject = {};
//查询日期
//需将 textField_ky16z24k 替换为您创建的组件的唯一标识
valObject.textField_ky16z24k = item["stat_date"];
//用户群聊数
//需将 textField_ky16z24l 替换为您创建的组件的唯一标识
valObject.textField_ky16z24l = item["4030_DAY"];
//新增群数
//需将 textField_ky16z24j 替换为您创建的组件的唯一标识
valObject.textField_ky16z24j = item["4031_DAY"];
//活跃群数
//需将 textField_ky16z24i 替换为您创建的组件的唯一标识
valObject.textField_ky16z24i = item["4032_DAY"];
//群聊信息数
//需将 textField_ky16z24h 替换为您创建的组件的唯一标识
valObject.textField_ky16z24h = item["4033_DAY"];
//内部群数量
//需将 textField_ky16z24g 替换为您创建的组件的唯一标识
valObject.textField_ky16z24g = item["4034_DAY"];
//部门群数量
//需将 textField_ky16z24f 替换为您创建的组件的唯一标识
valObject.textField_ky16z24f = item["4035_DAY"];
arr.push(valObject);
})
//将处理好的数据赋值给子表单组件
//需将 tableField_ky16z24a 替换为您创建的单行文本组件的唯一标识
this.$("tableField_ky16z24a").setValue(arr);
}
- Click save in the upper-right corner of the page.
2.2 Step 2: Add a connector
For more information about YIDA connectors, go to the following steps:Integration & Automation
Add a connector to the query enterprise group chat statistics form for data integration with the DingTalk data directory connector.
Procedure:
- On the background management page,> Integration & automation> Click the "create Integration & Automation" button. (Operation steps are shown in Figure 2.2-1)
Figure 2.2-1 connector entry
- Create a new connector named query enterprise statistics. Select form event trigger and click OK.
(The operation is shown in Figure 2.2-2)
Figure 2.2-2 create a connector
- Configure form event trigger> created> All Data> save 」. (The operation is shown in Figure 2.2-3)
Figure 2.2-3 configure connector form event triggering
- Choose application> Data Catalog> next 」. (The operation is shown in Figure 2.2-4)
Figure 2.2-4 select connector application
- Choose actions> get enterprise group chat Statistics> next 」. (The operation is shown in Figure 2.2-5)
Figure 2.2-5 Select connector execution action
- Configure execution actions> query time> fields> query date> save 」. (Operation is shown in Figure 2.2-6)
Figure 2.2-6 configuration connector execution action
- Add a new data node, add a single piece of data in the receive enterprise group chat statistics form, and set the value of "connector return data" to "business return result" field 」. (The operation is shown in Figure 2.2-7)
Figure 2.2-8 add and configure the add data node
- Click save in the upper-right corner of the page and click Publish.
2.3 Step 3: Submit form data
Procedure:
Submit the query enterprise group chat statistics form to trigger the connector. The returned results of the connector can be viewed in the enterprise group chat statistics details form. (The operation is shown in Figure 2.3-1)
Figure 2.3-1 submit form
3. Effect display
Operation path:Background management page> enterprise group chat data details> Data Management> View details (the final effect is shown in Figure 3.1)
Figure 3.1 final effect of connector