This template creates a bot to clean up your Gmail inbox. The bot inputs search terms into Gmail. It then loops through one search term at a time. On each loop, the bot clicks 'select all', then clicks 'matching emails'. Finally, the bot clicks 'confirm' to delete them all. This automation will only run if triggered in a page with Gmail open.
# How to Install the Gmail clean up your inbox bot
To install this Gmail template click 'Install template'. If you are a new user you will be required to create an Axiom.ai account before you can edit the template.
# Set up 'Enter custom data' step
- In 'Custom data' data enter a list of items to store as data; each line will be stored as a new row.
- Check the data preview is correct.

# How to configure the 'Interact with a page's interface' step
We have configured this step for you. But you may need to re-select buttons, and text inputs as sites can be subject to change.
- Enter URL - should already be populated with 'https://mail.google.com/mail/u/0/#inbox'.
- Enter Text: Search in emails - Select text field, use the selector tool to pick the gmail search box. In 'text' click 'Insert Data' and choose 'custom-data'.
- Press Key(s): Enter - Record an 'Enter' keypress. This submits the search.
- Click Element: Tick - Select the tick box that selects all the emails.
- Click Element: Select all messages that match this search - Select ths message which appears if the number of emails is over 50. Optional click - Tick as this message is not always present.
- Click Element: Delete - Select the Bin icon button
- Click Element: Ok - Select the OK button, Optional click - Tick as this message is not always present.
# Test your Inbox cleaner
We always recommed doing a trial run - click run now and the emails will be created but not sent. The 'Click Element: Ok' is disabled to stop the bot deleting any emails until ready.

# Ready to automate Gmail
Click on the step called 'Click Element: Ok', it will be greyed out. Click on the menu icon top right-hand corner of the step. Then click 'Enable widget'. When run, the bot will now clean your inbox.
# Troubleshoot
Try these measures if your bot is not working. We would recommend you watch the video to troubleshoot.
- No search terms are entered into the seartch box. Check and reformat you 'Custom Data' step if that is ok re-select the search box.
- The bot does not delete any emails - check the final step is enabled.
- Select all conversations that match this search does not click - reselect the button.