Gmail Attachment to GDrive Upload, but only 1 file is uploaded instead of all

Hello!! I’m happy it worked for you!

Let me try and answer your different points:

  • I tried to filter the attachments (only pdf, no png) but it didn’t seem to work, what did i do wrong ?
    Ben => In fact, since there can be multiple attachments, some PDF, some PNG or other formats, you need to verify the type just after the Iterator (your scenario will create a folder even if there is no PDF attached, but maybe your are ok with it?). So, after the Iterator, you can add a filter that lets pass only files with mime type = application/pdf. Like this


    If you want to stop any processing if there is no PDF at all (no attachment, or multiple attachments but no PDF, you can still do it with functions, in a filter sitting just after the Watch emails. It would use map and contains functions, like this:

    If I summarize, we say "extract the field contentType from Attachments (it becomes an array with the Mime type of all attachments), and continue if you find “application/pdf” (contains returns TRUE)
    In that case you still need the other filter, because if, for ex, there are 3 attachments, you want to upload only the PDFs.

  • The Watch Gmail module seems to often lose the “When to Start” information when i run once. Would it happen too if i schedule every month ?
    Ben => In fact, the Watch modules like that can keep track of the last record they grabbed last time the scenario executed. It allows you to get only the new emails everytime it executes. But when you are developing your scenario, you want to test over and over. In that case, you need to play with “Choose where to start”. Once the scenario is ready, you do a last Choose Where to Start to pick when you want it to extract emails. After that, it will handle everything alone.
    BUT, be careful, by default, watch Emails is configured to grab only 1 email at a time. it means that if you schedule your email to start every month, it will get only one email… (so only 12 emails per year…). You have to change this default value to a higer number, or schedule your scenario to run more often. The tuning of scheduling+number of results depends on the volume of emails you receive.

  • I’m thinking about sorting the mail first by date (a big folder for the year) then by email adress
    Ben => You can do that. The logic will be a little more tricky. You will have to play with the root folder where you search and create your subfolder. For example for Search Folders, you would use ‘map’ in the “Choose a Folder” and use Date functions to set the years/month/day as you want. It’s not simple because I’m not sure Google Drive allows you to create in one step folders and subfolders…

  • For the email adress, i was wondering if i use the same label for different email adress, would it be possible to regroup those different adress attachment in one folder (the labeled one ?)
    Ben => It depends on how you want to Label; but you could do it. For instance, you could use a Switch module or a Switch function on part of the emails to generate the label according to a criteria (ex: MAKE for all emails in the make.com domain, or GMAIL for all emails in the gmail.com domain, etc). It really depends on what you want to do. Then, you could use this label to generate the folder name, instead of the email address.

I hope I was clear :slight_smile: