Skip to main content

Integration & Automation-View/create DingTalk schedules

1. Usage scenarios

If the company needs to hold a full summary meeting at the end of each month, it needs to prepare for the meeting in advance. Members of the conference group need to create schedules for themselves to facilitate reminders. Now you can fill in and submit YIDA forms to automatically create a schedule for them on the DingTalk. Can beThe to-do list is written to the DingTalk calendar and displayed in the DingTalk calendar.

2. Implement functions

2.1 Create a schedule

(1) create a form page

When this form is submitted, integration automation is triggered to create a schedule.

(2) configuration Integration & Automation

2.2 View schedule

(1) create a custom page

(2) configure the connector to obtain schedule data

(3) copy the following code to Page JS

export function didMount() {
console.log(`「页面 JS」:当前页面地址 ${location.href}`);
// console.log(`「页面 JS」:当前页面 id 参数为 ${this.state.urlParams.id}`);
// 更多 this 相关 API 请参考:https://www.yuque.com/yida/support/ocmxyv#OCEXd
// document.title = window.loginUser.userName + ' | 宜搭';
this.dataSourceMap.getData.load({
inputs: JSON.stringify({
timeMax: new Date().getTime(),
timeMin: new Date().getTime() - 7 * 24 * 3600 * 1000,
userId: [window.loginUser && window.loginUser.userId]
})
}).then(res => {
let list = [];
try {
list = JSON.parse(res) && JSON.parse(res).recordResult || [];
} catch(err) {}
this.setState({
list: list.reverse()
});
})
}

/**
* button onClick
*/
export function onClick(){
const { id } = this.item;
const arr = id.split('_') || [];
const uniqueId = arr[0];
const recurrenceId = arr[1];
const page = `pages/detail/index?uniqueId=${uniqueId}&recurrenceId=${recurrenceId || ''}`;
const fallback_url = `dingtalk://dingtalkclient/page/calendar_detail?id=0&uniqueId=${uniqueId}&recurrenceId=${recurrenceId || ''}`;
const url = `dingtalk://dingtalkclient/action/open_mini_app?miniAppId=2018112162280005&ddMode=push&mainTask=true&keepAlive=false&newCalendar=1&page=${encodeURIComponent(page)}&fallback_url=${encodeURIComponent(fallback_url)}`;
window.open(url);
}

(4) bind parameters and events


3. Achieve results

3.1 Create a schedule

3.2 View schedule

4. Try it online

This doc is generated using machine translation. Any discrepancies or differences created in the translation are not binding and have no legal effect for compliance or enforcement purposes.
Copyright © 2024钉钉(中国)信息技术有限公司和/或其关联公司浙ICP备18037475号-4