Google Drive - react to new file

Hi everyone

What I need to do seems really easy but I’m struggling (probably missing the obvious) and despite searching I cannot find the resolution.

I want to detect the creation of a new file on Google Drive. Stupidly I set this up to run every minute and have destroyed my month’s operations!!!

Is there a way to trigger a scenario when a file is created on the Google Drive? Or do I indeed have to run the scenario at regular intervals

Thanks in advance
Mike

1 Like

Heyy @mdb213

Actually instant trigger is possible using this official API documentation for Drive using API call.

Let me know if you need more help!

Best,
@Prem_Patel

1 Like

Thanks @Prem_Patel , never even considered that way. I’ll give it a go and let you know

Appreciate you taking the time to reply
MIke

1 Like

After you receive update on webhook, do get list of all file uploads and sort them by latest and get the first file. Actually, this can be very close workaround as webhook won’t give you any meta data about file uploaded. but you can store those files created logs to match and filter latest ones.

I hope you get my point!

Best
@Prem_Patel

@Prem_Patel

I get the API part but do I still need to call it on a regular interval?
How does Google tell me that a file has been created?

Thanks
Mike

No, you can create watch endpoint with webhook, and webhook will receive blind update that something has changed. As we are using watch files, it will get files related updates. after that you can look for all recent files simply store ids on datastore or Google Sheet, filter and get the latest files. Can be a bit tricky but works😅.

1 Like

Thank you @Prem_Patel

Feels like a great showcase that many people would be interested in if you wanted to create :slight_smile:

1 Like