How to Automatically Store Multiple Email Attachments in a Dropbox Folder

Integromat
The Glue of the Internet
6 min readOct 15, 2019

Scenario: Downloads attachments from emails and uploads them to Dropbox. This scenario watches a Gmail inbox and is triggered when a new email with attachments is received.

Level of difficulty: Easy

Implementation Time: Approximately 10 mins

Prerequisites: The following is required to set up this scenario:

  1. A Google account for Gmail
  2. A Dropbox account

In those barrage of emails you receive daily, you may just miss something like an important doc or even worse - some cute cat pics. So in this tutorial, we will show you a quick and easy way to save email attachments directly to your Dropbox. This will save you the hassle of downloading attachments from your emails and manually uploading them to Dropbox! Pretty cool right? Let’s begin.

Step 1: Add the Gmail module

Let’s go ahead and add the first module to the scenario. Navigate to the top right of your Integromat Dashboard and click on the Create a scenario button. You can select both apps on the next page or simply skip as you will be able to choose your modules directly when building your scenario:

  • You will be taken to the scenario builder which contains an empty module with a question mark and a little clock icon. Click on the question mark and search for the Gmail module. Since you want to watch for incoming emails with attachments, you will need to select the Watch emails module . Every time you receive an email, the scenario will be triggered:
  • The first step is to connect your Gmail account to Integromat. If you have an existing account connected, skip to the next step. Click on the Add button on the top right under Connection:
  • Here you can edit the name of the connection or simply click continue:
  • Sign in to your Google account and click the Allow button at the bottom right to grant Integromat access to your account:

Once a connection is selected or a new one is added successfully, you need to set up the Gmail module.

  • Under the folder option, you have the option of selecting a specific folder you want to watch or you can select All Mail:
  • Under criteria, choose Only Unread emails and if you’d like to, select Yes to mark email message(s) as read when fetched. Click OK to continue:
  • The advanced settings offer more options. Check the box to view the options:
  • You can choose to process only emails that:
    — Are sent from a specific email address
    — That contain a specific subject
    — That contain a specific phrase
  • Next, choose where you would like Integromat to start watching your emails. You will also be able to select this option later on by right-clicking on the module. Here we have selected From now on.

Step 2: Iterate the attachments and upload to Dropbox

We now have the first Gmail module configured to watch for new mails. The next step in the scenario will be to iterate the attachments. The purpose of the iteration is to take all the attachments from a single email and upload them together to Dropbox. Irrespective of the number of attachments in the email, Integromat will upload all of them to Dropbox in a single execution. You have the option of uploading a single attachment from an email to Dropbox without using the Iterate attachments module. We have a 3-part video course on Iterators and Aggregators that you can watch here.

  • A second Gmail module will act as the iterator in this scenario. To add the next module, click on the little circle on the right of the first Gmail module.
  • Under Gmail, select the Iterators > Iterate attachments module:
  • In this module, you will see that the previous Gmail module is automatically selected as the source module. Simply click OK here:
  • The Iterator is fully configured, it’s really that simple! All that is left to do is add the final module which is the Actions > Upload a file module under the Dropbox app.
  • As in the previous step, you will need to add a connection and allow Integromat to access your Dropbox account:
  • You can choose the destination folder for the attachments by clicking on the Plus sign:
  • Alternatively, you can also map the folder name by toggling the map switch. This is useful if you need to fetch an element from another module to specify dynamic folder names:
  • The Source file will be automatically selected as Gmail — Iterate attachments. You can simply click OK to continue. Alternatively, you can select Map under Source file which provides an option to modify the file name by adding a prefix, suffix or manipulating the file name by applying a text function:

Step 3: Time to test

Your scenario is configured and good to go but we still need to do a quick test. First, save your scenario by clicking on the Save button. Now send yourself a mail with multiple attachments and click on the Run Once button:

  • We have sent an email with 3 attachments. The Gmail module was triggered, the attachments were then iterated and sent to Dropbox. You can click on the numbered circles to view the output of each module. This number signifies the number of operations consumed by each module in a single execution. Here is what the scenario looks like after the run:
  • You will see that there are 3 operations in the Dropbox module:
  • Here are the 3 attachments in our Dropbox:
  • If you receive the following output,it simply means that there was no data (emails) to process. You can click on the Choose where to start button and select All emails. Alternatively, you can select a specific email to start from by using the Select the first email option. Send an email to yourself and run the scenario again:
  • To set your schedule, click on the clock and enter your preferred interval:
  • Now all you need to do is turn on the scenario by toggling the switch at the bottom left:

And that’s it! A simple yet very useful scenario that will help you save time and do more with your email attachments.

Happy Automating! 🙌

--

--

Integromat
The Glue of the Internet

Connect apps and automate workflows using a beautiful, no-code visual builder.