back_image
blog-image

Automate Email Extraction into Google Sheets with Advanced Features

Author Image By Editorial Team

Last Updated: July 31, 2024

3 minutes

An Overview


In this blog post, we will explore “ How to Extract Data from Email into Google Sheets in a more advanced and efficient way using Free Google Apps Script and Google Spreadsheet. Additionally, the advanced features of this automation include trigger-creation on the sidebar, built-in button functionality, time-automation functionality, and more.


This guide is perfect for those who are looking to streamline their email management process and want to keep all important details organized in a Google Sheet. Let’s have a direct jump into the main automation, without any further ado!


Email Parsing Automation? | A Step-by-Step Guide


1. Open Your Google Sheet


  • To intimate this automated email extraction into the Google Sheet procedure, open up a Google Sheet where you want to fetch email details such as subject, body, attachments, and more.

2. Access Apps Script


  • Next, you need to click on the “Extensions” button and select the “Apps Script” option from the drop-down menu showing at the top of the page. This will bring you right in the coding section of the sheet.

3. Paste the Code


  • Once, the coding section of the Google spreadsheet has been opened to you then you have to copy a well-working code there.

4. Create HTML File


  • Now, you need to create an HTML file to get your Triggering adding an option on the front of the Google Sheet. For this, click on the plus (+) button next to “Files” in the top left corner and select the HTML option.

  • Here, you have to give an appropriate name to your file, as we have given “sidebar.html” and press Enter.

5. Run the Code


  • Now, take a step back to the previous and click on the “Run” button in the Apps Script editor. Next to this, you have to authorize the permission for further execution. For this, click on the “Review Permissions” then select a valid email account, and finally, click on the “Allow” button.

6. Verify Execution


  • Once you have done the authorization, then you will see that the execution has been started and completed as well within a few seconds. You can also rename your coding page if required.


7. Use the Google Sheet Buttons: “Export Emails”


  • After the execution, you will see that there are two new buttons appearing on the Google sheet at the top, one with the name “Export Emails” and another with “Set Triggers”.

  • Utilizing the “Extract Emails” button will automate your email extracting procedure from your inbox into the Google Sheet including all details like To email, subject, body, email URL, thread count, and timestamp.

  • For confirmation, you can click on the email URL, mentioned in the sheet which will redirect you to the original email thread.

8. Automate the Process: “Set Triggers”


  • There is no doubt that you can use this process for auto-extraction of the email. However, to automate the process on a set-up time periodically, you have to click on the “Set Trigger” button at the top of the sheet. This will open up a set trigger side panel on the Google Sheets.

  • Here, you need to select the “Export Emails” option from the function dropdown and have to choose a time interval (e.g., one minute) before clicking the “Set Trigger” button. This keeps your sheet updated with new emails periodically.

9. Verify Automated Process


  • For verification, we will send a few test emails and observe the updates in your Google Sheet, as you can see in this video. As a consequence, you can see that all newly received emails are appearing in the Google Sheet with their proper format such as date, and details, and ensure that the URL links along with automation are working correctly.

Conclusion


In this article, we will introduce you to “How to Extract Data from Email into Google Sheets” in a more advanced and efficient way using Free Google Apps Script and Google Spreadsheet. Additionally, the advanced features of this automation include trigger-creation on the sidebar, built-in button functionality, time-automation functionality, and more. Therefore, using our following steps, you can automate your email parsing process effectively and can be updated.

Also Check

Parse Email Body Data and Save it into (Google Sheets) | Apps script | Email Labels