I have this scenario where I capture several attachments via HTTP and then I attach them to an email using the HTTP - Get a file mapping.
It happens that in some cases, the attachments do not exist and the lack of that document causes an error in the email module.
I tried to work around it by creating a handler (resume) error in the HTTP module, but this only resolves the error in that module.
The final objective of the scenario is to send the email with any attachments that exist.
The solution I have thought of so far would be to create specific filters for each situation (whether or not each attachment exists), but I would like to know if there is a simpler solution, as my scenario already has several other filters and paths.
Right I can see that - but is the structure of the array aggregator correct for what the email module expects in the attachments mapping area? The error is Array of objects expeced in parameter ‘attachments’ which tells me somehow the array is not exactly correct for what the email module expects to be passed into it.
Every result (item/record) from an Iterator module will output a bundle. To “combine” them into a single structure, 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.
Read this
The Array Aggregator module also allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.
Here is an example of using the “Target structure type” of an Array Aggregator module:
As you can see, the “Map” toggle on fields are used when you have an array. You can easily build an array variable to map to a field, by using an Array Aggregator module and select the “Target Structure Type” as the future field you want to map the array into.