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.

Demo first

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.

  1. Copy the spreadsheet. This is the same spreadsheet as in the demo.
  2. Refresh your copy of spreadsheet.
  3. 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.
  4. Select Row 11 and Row 12.
  5. Click the menu Add-ons > Sheet2Filter > Create Filters from Selected Rows.
  6. You will be prompted to authorize permissions for the first time. Grant it.
  7. 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.
  8. Now go to your Gmail and verify if those filters are successfully created.

Notes

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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!