Gmail Emails to Google Sheet

Continuing the discussion from Any Updates on Google Voice Integrations? SMS?:

@Marc_Dillon What would be the Google App Script code/implementation process be to add one set of auto labeled emails from Gmail into a Google sheets table? Thank you very much for responses. I did look through all your history for the code and but there were only posts on exporting gmail attachments, something with sent emails, and csv’s if I remember correctly but it was a lot of content you’ve provided. If I’m mistaken please send me a link to the post.

This table would need to be continuously updating, at the slowest once every half hour and ideally real-time or less than a minute.

I would need from, to, cc preferably, subject, body, images in body, and attachments but if attachments don’t work that’s probably ok.

I’ll reply to these emails which are actually Google voice texts with another email typed by employee with Appsheet which will text the customer, the newly created email gets added to email/comm table, and emails are referenced to customer by phone which is in the last characters of the subject line. Then every customer will have a related communications column with all history of comm, spoken conversation summaries could be added as well.

I could always use mail parsers or Zapier or other integrations but I need to keep cost low and ideally within the Google Universe.

Here are some resources I found which I believe are on topic but not perfect, and I don’t know GAS enough to make it work.

And code for it

And this handy CloudHQ free extension which may be too good to be true but also seems the simplest. Please let me know if anyone has experience with this solution of theirs.

I would greatly appreciate any help I could get on generating this table close to real-time. Thanks.

3X_d_5_d51363a862e7ab883241c312ac5d7f271579cdd3.gif

Edit: this is pretty much what I need. I will try and make it work. I feel a little silly making this post and asking the pros too many questions and eventually finding the answer that was already there.

@MultiTech_Visions attachment to table setup is really nice but I’m sure I’ll run into problems not knowing GAS.

[APPS SCRIPT: Download Gmails to GSheet, using Gmail Filters/Labels](https://community.appsheet.com/t/apps-script-download-gmails-to-gsheet-using-gmail-filters-labels/38184) Tips & Tricks ?

This Apps Script will monitor your Gmail for new emails that match a certain label, and: Add a New Row to GSheet (Time, Sender, Subject, Body) Remove the email from the Inbox Remove the label Optionally add a new label to processed emails This lets you define the email-matching logic using Gmail’s search operators, instead of having to edit the script code. The only thing you have to edit is the label-name to monitor, and the GSheet_ID.

2 Likes

Wesley:

What would be the Google App Script code/implementation process be to add one set of auto labeled emails from Gmail into a Google sheets table? Thank you very much for responses. I did look through all your history for the code and but there were only posts on exporting gmail attachments, something with sent emails, and csv’s if I remember correctly but it was a lot of content you’ve provided. If I’m mistaken please send me a link to the post.

That’s quite far beyond the level of help I’m willing to provide here. Even if I wanted to, I certainly don’t have that kind of time. Maybe someone else would want to, but I wouldn’t expect it. Especially since this is an Appsheet forum, not a GAS forum. So, you can either buckle down and learn GAS yourself, find a different solution, or hire someone to write the GAS for you.

That last Tips and Tricks thread that you linked to seems to have most of what you’d need. Here are some supporting GAS docs as well.

4 Likes

This is the simplest solution to import emails from gmail to google sheets: https://workspace.google.com/u/0/marketplace/app/email_parser/40769086099

You can parse individuals elements of the email body with complex variations