Most out of your workflows specifically the iterator and aggregator um they might sound scary but don't worry by the end of this video you will know exactly when and how to use them.
So let's take a look at an example first this workflow is looking for new emails and then saving attachments to google drive folder.
But to better understand why do we need to use the iterator here in this workflow we need to take a look at how does the email module send the attachments to the.
Google drive folder and what i mean is it sends them in an array now an array is essentially a collection of items so the attachments are in an array.
And that array contains attachment 1 2 3 and so on and what the iterator does it extracts the items from the array so that they can be sent as separate items to the google drive folder so that they.
So first look for the flow control menu and select the iterator it's looking for an array so let's click this field and connect the attachments array here.
Also you recognize arrays by the square brackets next to the name so you'll see that there are multiple arrays here and in the data mapping section and also the tooltip tells you that it's.
An array so let's connect the attachments array like this and then the last one is going to be the google drive upload the file module.
You can see that the google drive module recognized the connection with the iterator and selected it as the source module which is correct.
Now we can also click this map option to look at the manual mapping of this setup and here we can see that for the file name and for the data we have data from the iterator so the file name.
Posts Related:
And the data - Make Automate
Coming from the iterator module which is correct so with this setup every time a new email comes in it's going to grab the email.Check the contents of the attachments array and if there are any attachments send them one by one as separate items to the google drive folder so visually it looks like this.
Email coming in checking for attachments and then sending them as separate items so we've covered the basics of how to recognize arrays how to extract.
Items from an array using the iterator and now we'll take a look at the aggregator and what it does essentially it does the opposite so it puts items in an array.
So where can this be useful let's take a look at a different example this time a workflow that's looking for new files in a google drive folder so let's say you have a folder where you put finished.
Files for your project and then you want them to be sent automatically in an email as attachments so for this workflow we have four modules.
The first one is looking for the new files the second one downloads the files so that they can be processed in this workflow and then the array aggregator creates an.
Array from the files coming from here and then sends that array to the email module which then sends a single email with all the attachments attached to it correctly.
So let's again take a look at the setup we will delete these two and we'll continue from here again look for the flow control menu.
And select array aggregator
You will notice that there is a little bit more setup to do but don't worry we can make this easier by connecting the last module.So that's going to be the email module send an email now let's go back to the area aggregator setup first we'll select the source module so that's going to be the watch.
Files module and then for the target structure type because we've connected the email module it's going to correctly recognize that we want to create.
Attachments as an array so we have this option here attachments and then for the source file we have this correctly selected automatically.
So google drive download file module is the source for the array aggregator we can also switch here to manual mapping and take a look and we see that the file name and the.
Data coming from the previous module here and that is correct for the last part we can take a look at the email module.
And down here for the attachments let's switch to map and connect the array coming from the array aggregator now with this setup.
Every time you upload files to that folder it's going to grab them download them put them in an array and then send this array to the email module which is going to send one email with.
All the attachments with all the files as attachments to that single email and that's it we've covered arrays how to recognize them how to extract items from an array.
How to put items in an array and how to work with data inside arrays i hope this was useful and i hope this will help you.