Expand my Community achievements bar.

SOLVED

Attach Multiple Documents to an Email

Avatar

Community Advisor

Has anyone successfully created a scenario that attaches multiple docs to one email? 

 

I have been working on a scenario to be able to attach multiple files from one folder to an email but am running into a roadblock.

 

I have been experimenting with the iterator, aggregator and variable modules. When I test, the email will only attach one document but I can see in the aggregator that it did create 1 bundle with all files found in the folder. I am not sure if I am missing something in my setup with the email attachment setup. Also, I am new to using the iterator, aggregator and variables so maybe I am not setting up something correctly.

 

For context, I need to be able to attach docs to the email as we have users on our email distro that are not in Workfront and we do not need them to be.

 

Thank you for any help in advance.

 

 

Current scenario set up:

 

Screenshot 2024-10-23 at 9.49.15 AM.png

 

Aggregator result:

Screenshot 2024-10-23 at 9.51.06 AM.png

 

Email Result: only will bring in 1 file as an input instead of multiple files

Screenshot 2024-10-23 at 10.00.09 AM.png

 

Email Attachment Setup:

Screenshot 2024-10-23 at 9.53.41 AM.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @KierstenKollins 

 

you're close. 

 

But first, note in your last screenshot: You're literally setting ONE attachment. And you're referencing the first in the array from the aggregator (note the [1])

 

Instead, you like need to 

  • change the setVariables so they match the expected Attachments attributes
  • toggle the map switch
  • pass in the array from the aggregator

 

When you toggle that switch, you're telling the module "I'm passing you an array that has a list of objects with the attributes File Name and Data"

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

Hi @KierstenKollins 

 

you're close. 

 

But first, note in your last screenshot: You're literally setting ONE attachment. And you're referencing the first in the array from the aggregator (note the [1])

 

Instead, you like need to 

  • change the setVariables so they match the expected Attachments attributes
  • toggle the map switch
  • pass in the array from the aggregator

 

When you toggle that switch, you're telling the module "I'm passing you an array that has a list of objects with the attributes File Name and Data"

Avatar

Community Advisor

Thank you! I just figured that out that I could put the array in there all together using the map button.

 

I took out the variables to make it more simplified and ended with this and it worked perfectly!

 

Screenshot 2024-10-23 at 5.25.21 PM.png

 

 

Avatar

Level 2

when I use the same, I am getting file name missing error.

Avatar

Community Advisor

Kindly provide more context as there's no way to help you otherwise. 

Avatar

Level 1

Hi 😊, we have the problem comes when you want to attach some documents filtering by task or a field from a dataStore, for example, if one task have two or more documents, you can't get all the docs attachet for this task, because the result is an array with all these documents, and the module does not accept this structure, so you have to iterate on these result to get all docs, and you miss the filter when you want to send the email with the corresponding docs for this email.

On our case we have this filter: {{map(87.array; "fileName"; "`DE:Código`"; 121.data.`Codigo Material`)}}

where 87.array has the documents,

"`DE:Código`" -> key for filtering

121.data.`Codigo Material` -> value for the key

 

If this array has more than one document for this filter, we have this output:

SergioUs1_0-1763479756787.png

so we can't use this structure for the map of the array aggregator:

SergioUs1_1-1763479823222.png

We can only use "get" to get the first document, but there is not posibility to get all the docs in the array.


Is there any way to do this?

Thanks in advance

Avatar

Level 2

Going to be trying out this very soon! Keep you posted