Attach multiple file from Onedrive to email module

Hi everyone,

I have been stuck for a couple of days, I’m looking to attach multiple files (PDFs based on Payments due dates) from a OneDrive folder to an email module. I’m aggregating all the due payments that belong to one client and sum them up and include them in the email body (Example: 3 payments due on March 24th - $50, $100, $50, I’m putting in the email that $$200 is due on March 24th). I’m just having problems adding all 3 attachments in the same email.

I found some similar posts and followed already what they advised, but the best I’m getting is the email module sending one email for each attachment sent to it.

I have tried an Iterator before the downloads module but then I get 4 operations, one with each file, and even with the array aggregator after the downloads file module, it still keeps them separate.

I tried without the iterator but get I’m only getting 1 file…


Is it even possible to have more than one attachment or is the issue is either OneDrive or the email module? I usually work with Google Drive, I haven’t used OneDrive much…

Many thanks

Andrea

Hi Andrea,

The source module of the Array Aggregator should be an Iterator, not the Download a File module.

3 Likes

Hi Vasyl much appreciated! I spent way too long on this.. Thank you!

2 Likes

Welcome to the Make community!

Setting the Correct Aggregator Source

You need to set the “Source Module” field of the aggregator to where the bundles are coming from. This is usually an Iterator module, but can also be a search/list/repeater module.

For more information, please refer to the Make Academy.

Combining Bundles Using Aggregators

Every result (item/record) from trigger/iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.

Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.

You can find out more about the other types of aggregator modules here:

Mapping a Specific Structure Into a Complex Field

The Array Aggregator module is very powerful because it allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.

This is done using the “Target structure type” field in an Array Aggregator module.

Here is an example:

As you can see, the “Map” toggle on complex fields are used when you have an array. You can easily build an array variable to map to a future module’s field, by using an Array Aggregator module and select the “Target Structure Type” as the future module’s field you have mapped the array into.

Example

Here is an example of how your scenario could look:

This is just an example. Your final solution may or may not look like this depending on your requirements and actual input data.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Hi Sam, thanks for the expansive reply.

I already managed to solve the issue but it’s definitely good to know. I found that of all the Make functions and features the Iterator/Array modules are the ones that I still need to really understand fully and can sometimes get me stuck, so it’s definitely something I need to spend more time on in the Make Academy.

I appreciate you taking the time to reply.

Andrea

1 Like