Document Delivery Automation

Hi everyone!

I’m working on automating a document delivery process and could use some advice. Here’s the setup:

  1. We receive multiple documents via a specific email account.
  2. These documents are renamed and aggregated into a single email attachment for delivery.

The array aggregator works great when creating the email draft, but we’re struggling with pulling in additional text outputs (like specific details from the flow) to build a complete email template. The aggregator seems to overwrite or exclude this data.

We’ve tried using custom aggregation methods, but that adds complexity and creates new issues. Currently using the “attachments” target structure, which works to aggregate the attachments to one draft with a defined group.

We upload the finalized documents to Salesforce for the intended recipient. That part works fine—it’s just the variable mapping from previous modules that’s causing disruptions.

Has anyone tried creating something similar? I’ve tried every work around I could think of, no luck.

Any tips or insights would be super helpful; new to using make.

Thanks in advance,

Hi @DocDelivery,

did you select all of the data you want it to aggregate inside the array aggregator?

Also, could you send a screenshot of the array aggregator configuration?

Thanks a lot! :smiley:

Thanks for the reply Julius.

Here’s a screenshot of the array and the target structure. It won’t allow me to proceed unless I choose the custom option. However, when I go the custom route I start running into issues—specifically, the grouped files aren’t attached.

I’ve tried countless variations and workarounds to figure this out but no luck so far. I hope this provides some clarity. Thanks again for jumping in to help.

Ah, I see the issue. The taget structure is a way to format it correctly for a module that comes later which needs a specific format.

Leave that at custom.
Which module exactly generates several bundles that you want to aggregate? Unfortunately, the first screenshot is too low quality for me to recognize the module names.

Ps. Make sure to click on the reply button or tag me like this @DocDelivery, otherwise I won’t get a notification. Only found this again by accident :smiley:

@Juliusforster

Thanks Julius. The “watch emails” module which is the first one in the scenario generates the bundle of attachments we want to email. We have set variables to group them to be sent to the right recipient.

I’ve gone the custom route as well.

We ran into a rabbit hole of file name and attachment errors when running the draft email module (end of the scenario)

Some examples amongst others:

  • Some check boxes on the custom option would disappear after saving; as a work, I set a new variable to be aggregated. This worked, but it didn’t solve the problem as a whole.

  • Hit “select all” to try various maps, but again, when saved, the checkboxes don’t seem to stick.

Here is a before and after example:


The crucial info needed is the “Data” to be aggregated/bundled while not losing the other maps.

The Iterate Attachments Module (The second one in the scenario) has the data checked off:


When running the scenario and mapping “attachments”

I get this error:

I hope this clarifies?

Thanks again.

Got it. Could you send over the blueprint for the scenario so i could check what the problem is? Feel free to send it over via DM if you don’t want to share it here. It’s hard to find the issue without being able to check the scenario directly.

Thank you

Edit: Are you sure the attachments array you’ve selected inside the Attachments field for Gmail has the correct format?

Just checked real quick. Here’s the format the gmail module needs for attachments:

{
       "cid": null,
        "data": "DATA HERE",
        "fileName": "FILENAME HERE"
}

So yours looks okay, but the file name could actually be the issue. Does it include an ending (e.g. .jpg, .png, .pdf at the end?)

Easiest way would still be if you send over the blueprint

It does include “.pdf”
Screenshot 2024-12-20 at 3.43.09 PM

I remapped the gmail draft with cleaned up file name, which worked.

Now the data being bundled is an issue. Gmail is picking up 2 attachments:

Screenshot 2024-12-20 at 3.44.50 PM

The array map is only aggregating 1 on of them. So now 2 email drafts are being opened instead of one.
Screenshot 2024-12-20 at 3.45.15 PM

I mapped the data in the data in the array, out put is 1 attachment:

I mapped the entire array to see if I missed any other data related info, still one attachment.

The array agg. has a pretty effect group key, because this is pulled from the subject of the emails, so I don’t think it’s a grouping issue.

Blueprint is sent.

@Juliusforster

tagging.

Thanks for tagging me @DocDelivery. I didn’t receive the blueprint though.

Hi @Juliusforster

I’ve resolved the issue by cleaning up the file name. It seems the aggregator was referencing both the original file name and the new renamed file, which caused a conflict.

To fix this, I created a variable called “fileName” and linked it to the new, cleaned file name output. I then aggregated only this updated variable in the array. The Gmail module successfully accepted this setup.

2 Likes