How to make google script trigger in spreadsheet on google drive folder changes?

145 views
Skip to first unread message

Heeg Ru

unread,
Oct 16, 2021, 4:18:01 PM10/16/21
to Google Apps Script Community
Hi! I have a google dive folder https://drive.google.com/drive/folders/1drFCfJcb9KcB2pGHPgXX3W97OSdkVPw_


when I run manually my script, it puts folder files id to my spreadsheet.
But I want this script run automatics, if something changes in my folder.(add or remove or rename file). 
How to make event trigger for it? 

  

Tanaike

unread,
Oct 17, 2021, 8:18:06 AM10/17/21
to Google Apps Script Community
I thought that there are several methods for achieving your goal.

1. How about using "Changes" of Drive API?
This official document (Push Notifications) might be useful.

2. How about using IFTTT?
When IFTTT is used, when the change of your Google Drive is changed, for example, you can receive the request using the Web Apps created by Google Apps Script. But, I'm not sure about the detail of "if something changes in my folder.". So I'm not sure whether this method is suitable for your situation. I apologize for this.

3. How about checking the folder using the time-driven trigger of Google Apps Script?
In this case, the folder is checked by a cycle using the time-driven trigger. For example, the folder can be checked every 5 minutes. This can be achieved by Google Apps Script. This cannot be real-time. But I thought that this will be a simple method.

If these were not useful, I apologize.

Reply all
Reply to author
Forward
0 new messages