How to automatically add a schedule from Google sheets to Calendar using Apps Script 自動(dòng)添加日程到日歷

How to automatically add a schedule from Google sheets to Calendar using Apps Script

如何使用Apps腳本從googlesheets自動(dòng)添加日程表到日歷

Here is the simple procedure to automatically add a schedule/event from the Google sheets to Calendar using the Apps?Script.

Step 1:?Open a Google Sheet and create a schedule or an?event.

下面是一個(gè)使用Apps腳本從googlesheets自動(dòng)將日程表/事件添加到日歷的簡(jiǎn)單過(guò)程。

第一步:打開(kāi)一個(gè)Google表單,創(chuàng)建一個(gè)日程表或事件。


例子

Step 2:?Click on Tools in the toolbar → Select Script?editor.

第2步:?jiǎn)螕艄ぞ邫谥械墓ぞ摺x擇腳本編輯器。


選擇腳本編輯器

Step 3:?Copy this code and then change the highlighted portion

Note:?Choose your Calendar?Id.

步驟3:復(fù)制此代碼,然后更改突出顯示的部分

注意:選擇日歷Id。

function scheduleShifts() {

????var spreadsheet = SpreadsheetApp.getActiveSheet();? ?
????var calendarID = spreadsheet.getRange("C4").getValue();
????var eventCal = CalendarApp.getCalendarById("calendarId");

????var signups = spreadsheet.getRange("A5:C7").getValues();

????for (x=0; x<signups.length;x++){
?????????var shift = signups[x];
?????????var startTime = shift[0];
?????????var endTime = shift[1];
?????????var volunteer= shift[2];
?????????eventCal.createEvent(volunteer, startTime, endTime);
?????}
}

How to choose your Calendar?Id?

Just type Calendar on the Google browser and then you can refer to the below?link:

如何選擇日歷Id?

只需在谷歌瀏覽器上鍵入日歷,然后您就可以參考以下鏈接:

谷歌搜索日歷? 在設(shè)置里面可以獲取


id獲取

Step 4:?Save the code and then run?it.

Step 5:?Give the Authorization to run the?script.

Select?Review Permissions?→Choose your?Google Account?→Select?Advanced?Options →Click on?AllowButton.

步驟4:保存代碼,然后運(yùn)行它。

步驟5:授予運(yùn)行腳本的權(quán)限。

選擇查看權(quán)限→選擇您的Google帳戶(hù)→選擇高級(jí)選項(xiàng)→單擊允許按鈕。



Step 6:?It will run Successfully?:)

You can check your Calendar?then.

第六步:運(yùn)行成功:)

你可以查一下你的日歷。


That’s it?:)

無(wú)了

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容