Integration & Automation-obtain a list of Associated organizations
1. Usage scenarios
As one of the DingTalk interconnection platform products, the associated organization function provides powerful organizational structure management capabilities for medium and large organizations to help usersAchieve cross-organization contacts, application interconnection, seamless communication and collaboration between superior and subordinate organizations.
- Cross-organizational communication, business approval, and work report.
- Multi-organization decentralized management, real-time synchronization of personnel structure, improve management efficiency.
2. Implementation steps
2.1 Step 1: Basic form design
2.1.1 Create and configure query forms
Procedure:
- Create a normal form named get Organization information 」.
- Add a drop-down radio component named target, and add two options, query backbone organization and query branch organization, respectively. Required. (The operation is shown in Figure 2.1-1)
Figure 2.1-1 add and configure the drop-down radio component
- Click save in the upper-right corner of the page.
2.1.2 create and configure a query result record table
Procedure:
- Create a normal form and name it "Backbone Organization query result record 」.
- Add a multi-line text component named "connector return result" and set the status to "hide 」. (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 "Backbone Organization query results" 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 two single lines of text to the subform, named "Backbone Organization name" and "Backbone Organization CorpID" respectively, and set the status to "read-only 」. (The operation is shown in Figure 2.1-4)
Figure 2.1-4 add and configure a single-line text component
- On the left side of the page, open the JS action panel and add the following code to
didMount
Function. (The operation is shown in Figure 2.1-5)
Figure 2.1-5 configure JS panel content
//图2.1-5 所示代码部分
//获取多行文本组件数据并赋值给res变量
//「textareaField_kwlgqhti」需要替换为您所创建的多行文本的唯一标识
const res = this.$("textareaField_kwlgqhti").getValue();
//进行数据格式转换,将多行文本组件数据字符串格式转换为对象形式
let obj = JSON.parse(res);
//创建一个名为arr的空数组,用于存放接下来处理好的数据。
let arr = [];
//遍历对象,用于获取需要展示的字段
const list = obj.map(item => {
let object = {};
//其中「textField_kwlgqhtk」与「textField_kwlgqhtl」为子表单内两个单行文本组件的唯一标识
//需要替换为您所创建的单行文本的唯一标识
object.textField_kwlgqhtk = item.union_org_name;
object.textField_kwlgqhtl = item.union_corpid;
arr.push(object);
})
//将处理好的数据arr回填到子表单组件
//其中「tableField_kwlgqhtj」为子表单组件的唯一标识
//需要将其替换为您创建的子表单组件的唯一标识
this.$("tableField_kwlgqhtj").setValue(arr);
- Click save in the upper-right corner of the page.
- Repeat steps 1-6 to create a branch organization query result record 」. (The operation effect is shown in Figure 2.1-6)
Figure 2.1-6 create a branch organization query result record form
2.2 Step 2: Create and configure a connector
For more information about YIDA connector functions, follow these steps:Integration & Automation
Create a connector for the Get organization information form to obtain information about the associated organization.
Procedure:
- Background management page> Integration & automation> create Integration & Automation 」. (The operation is shown in Figure 2.2-1)
Figure 2.2-1 connector entry
- Name the connector "query associated organization information", select "form event trigger" trigger type, and click "OK 」.
(The operation is shown in Figure 2.1-2)
Figure 2.2-2 create a connector
- Name the connector "query associated organization information"> Select "created" in "form event triggering"> select "all data" in "data filtering"> click "OK" 」. (The operation is shown in Figure 2.2-3)
Figure 2.2-3 configure connector form event triggering
- Add a conditional branch node: when the target of the conditional rule is equal to the query backbone organization, add a connector for obtaining the backbone organization and add a new data node; Otherwise, add the Get branch organization connector and add the add Organization data node. (The operation is shown in Figure 2.2-4)
Figure 2.2-4 add and configure branch conditions
- Configure connectors under branch 1
- Configure connector application: choose associated organization application> Click next. (The operation is shown in Figure 2.2-5)
Figure 2.2-5 Select connector application under branch 1
- Select the connector to perform the action: Choose get backbone organization> Click next. (Operation is shown in Figure 2.2-6)
Figure 2.2-6 select the connector of branch 1 to perform actions
- Configure the connector and click save. (The operation is shown in Figure 2.2-7)
Figure 2.2-7 configure the execution action of the connector under branch 1
- Configure the add data node of branch 1. (The operation is shown in Figure 2.2-8)
Figure 2.2-8 add and configure the add data node under branch 1
- Configure connectors under branch 2
- Configure connector application: choose associated organization application> Click next. (The operation is shown in Figure 2.2-9)
Figure 2.2-9 select connector application under branch 2
- Select the connector to perform the action: Choose get Branch Organization> Click next. (The operation is shown in Figure 2.2-10)
Figure 2.2-10 the execution action of selecting the connector under branch 2
- Configure the connector and click save. (The operation is shown in Figure 2.2-11)
Figure 2.2-11 configure the execution action of the connector under branch 2
- Configure the add data node under branch 2. (The operation is shown in Figure 2.2-12)
Figure 2.2-12 configure the add data node under branch 2
- Click save in the upper-right corner of the page and click Publish.
2.3 Step 3: Submit form data
Trigger the connector to receive the data returned by the connector and display it after processing.
Procedure:
Fill in the form data and submit it. (The operation is shown in Figure 2.3-1)
Figure 2.3-1 submit form data
3. Effect display
Figure 3-1 connector effect display