We’re flooded with hundreds of emails everyday in the modern world. Gmail has the filtering feature to automatically organize emails by certain rules. However, you will need add it one at a time. This article shows you a way to create bulk Gmail filters from Sheets. It will saves hours of time.
How it works
The sheet shown in the demo has an apps script that automates the process. It creates 2 menus under Add-ons > Sheet2Filter, Refresh Labels and Create Filters from Selected Rows. The Refresh Labels function will load your Gmail labels to the sheets in column L and load forwarding addresses in column M. And the Create Filters from Selected Rows is the power house.
So apply these steps to work for your Gmail.
- Copy the spreadsheet. This is the same spreadsheet as in the demo.
- Click the menu Add-ons > Sheet2Filter > Refresh Labels. It reloads custom labels and forwarding addresses from your Gmail to the drop down validation of column L and M.
- Select Row 11 and Row 12.
- Click the menu Add-ons > Sheet2Filter > Create Filters from Selected Rows.
- You will be prompted to authorize permissions for the first time. Grant it.
- The script will run and display the result in column S and T. If this is successful, it will say CREATED; Otherwise it will say FAILED with column T as the explanation. In this case, you will investigate what’s wrong on the row and do it again.
- Now go to your Gmail and verify if those filters are successfully created.
- The From, To, Subject, Has the words and Doesn’t have columns support search operators, like OR or AND. To learn more about search operators, Google has a support page here.
- The Size column uses a special format to specify email sizes. The pattern is easily understood from these examples, < 10 MB or >5KB or <100 B.
- Apply the label and Forward to are selectable in the drop-down lists after you run Add-ons > Sheet2Filter > Refresh Labels if your Gmail has set up these.
- Column Always mark it as important and Never mark it as important are mutually exclusive. In another words, checking one will un-check the other.
- Column Categorize as has Primary, Social, Updates, Promotions and Forums. Any other categories are rejected.
If you find any issues or questions, leave the comments below. Hope it helps. Have fun!