What is your goal?
I need the ability to separate email attachments by file type (pdf vs images). I receive emails from customers that typically have a single purchase order in pdf format, but occasionally have image files included. There could be a single image file or possibly 10 or more. Im all set with the pdf separation path in my scenario as the filtering works just fine for those.
Ideally, I would like to check my existing database to see if the attached email files already exist but am having much difficulty getting the image files parsed in a way that I can filter if they dont exist and then POST them with HTTP, GET the newly POSTed image files and then extracting the file IDs in a comma separated string that is usable for my HTTP PUT module further down the line.
Below is an example of the specific router leg Im struggling with screenshots showing the required information. Disregard the other router destinations as I only wanted to show what the final design actually looks like and didnt know if the routing would make any difference when suggesting a solution.
-
Webhook - email received with multiple file attachments. (1) Tracking # 1053778 Purchase Order.pdf and (5) Screenshot xxx.jpg
-
Text Parser - pulls the Tracking # from the email subject as this is the key reference used for all orders
-
Iterator - pointed to pull all attachments from email
-
Router - filters added after each leg to separate pdf from image files
Route 1 - filters by Iterator filename to push pdf attachments here Route 2 - filters by Iterator filename to push anything that is not a pdf to POST all files with HTTP module. I would like to confirm if the email attached images already exist before POSTing duplicate ones, but that isnt a priority right now. This was the only way I could get the HTTP module to POST all filtered image files. The Sleep module was added to slow the POST as it was too fast and missing images. Route 3 - Added an Array aggregator to prevent multiple runs for all remaining modules. HTTP GET module to pull all database files, including newly POSTed ones in Route 2. I need a way to find the file ID of either the existing or newly POSTed files text formatted with comma separate string to include all image files matching the email attachments HTTP GET module to pull all database orders followed by Iterator > filtered by Tracking # > Aggregator. HTTP PUT module that will need to be formatted with JSON below to include comma separated string from previous module
{
"requestingUserID": 792136,
"customFields": [
{
"customFieldID": 709088,
"name": "Attachments/Photos",
"attachmentIDs": [fileID1,fileID2,fileID3,fileID4,fileID5],
"isHidden": false
}
]
}
Sorry, for some reason I cant paste screenshots here and the file upload only accepts one file.
What is the problem & what have you tried?
No matter what Ive tried, I cannot gather and filter the file IDs to be aggregated into a comma separated value to be use in the HTTP JSON coding. Ive used various combinations of Iterators, Array aggregators, Text aggregators, HTTP modules. Just when I get some early modules to do something, adding iterators or aggregators makes them disappear to following modules.










