A Google Spreadsheet add-on that crawls usernames and emails based on a Gmail specific label.
For instance, if you want to send a newsletter to someone labeled Participant-2022
, you can use this add-on that easily crawls sender information in just one click.
-
Create a new Google Spreadsheet.
-
Click Extension > Apps Script to open the Google Sheet Script Editor.
-
Paste the code of
extract-email-by-label.js
into the edit area. -
Configure the
EXCEPTION_EMAIL_1
toEXCEPTION_EMAIL_3
variable if you want to ignore some e-mail addresses. If you need more exception rules, just union them with the&&
operator. -
Select the function
onOpen()
. -
Back to the spreadsheet, in each sheet, input the label name in
B1
. If the label is nested, connect the parent (and even grandparent) label name via-
. For example,Shopping-Amazon-Receipt
. -
Click the Extract Emails > Extract Emails...
-
The result will show up since the forth row.
-
If the sender doesn't has name, it will display "N/A".
-
Due to the Gmail's restriction, the maximum number of crawling mail is 500.
-
Each time we click Extract Emails, it will clear the current sheet and re-generate the data. If the former data is needed, please backup or create a new sheet before using this add-on.
-
If there is an error, please check the label name (missing blank? wrong spelling?) or nested relationship.
-
Google might change the position of
Apps Script
menu (it was at Tools > Script editor before), if you can't find it, please read the latest Google Spreadsheet Guide.