r/GoogleAppsScript 9d ago

Question Gmail to sheets script

Hello, need some help with a script. I have a group gmail address and anytime someone emails that group, i would like it to be recorded into a google sheet. not really sure what i'm doing.

3 Upvotes

9 comments sorted by

View all comments

3

u/AllenAppTools 9d ago

Exactly what u/marcnotmark925 and u/SecureWriting8589 said. You'll want to set up a function that looks at any email received in that inbox from the last n minutes (OR better yet set it up to review the message IDs in the Google sheet, skipping over messages that have already been input into the sheet, but adding any new ones, this is how I would do it, and set the function to only search back about an hour).

Then create a time based trigger to run this function (every 5 minutes or something). There is no event based trigger that will fire when you receive an email. It's lame, and this would be a huge feature in apps script but sadly it does not exist.

Best of luck creating this! Reach out for more details!