I’m working on my first automation that monitors incoming emails, checks their attachments, and continues processing only if at least one of the attachments is a PDF file. If no PDF is found, the automation follows a fallback route.
The automation should check if any email attachment contains a .pdf or .PDF file.
If no PDF is found, the router should direct the process to the fallback route. If a PDF is found, the automation continues by iterating through the attachments.
It should filter out only the .pdf or .PDF files and upload them to OneDrive before proceeding further.
The issue:
For some reason, when a PDF file is not the first attachment (e.g., the first file is a .jpg, .doc, etc.), my filter doesn’t work as expected (see attached images).
I’ve tried troubleshooting, but I can’t spot the issue. Even the Make AI agent couldn’t help.
I’d really appreciate any advice! Thanks in advance for your time.
I may have found out that in the filter - only first attachment is considered. Is there a way that all the attachments are considered and if any of it contains .pdf it goes through?
thanks for answer! I think your recommended solution would not work correctly. If i had 2 attachments - one .pdf and one .doc - the .doc one would trigger bundle 2, which would result in error.
I found a workaround by using text aggregator tool. I first aggregate MIME type of all attachments into text and then check if any of the attachment contains “pdf”. If not, fallback route is used. If there is a file, then the automation proceeds.
Then I iterate files again and use your suggested solution.
thanks a lot for answer and recommendation. I have tried this solution before and after you mentioned it and I think i might have a mistake somewhere in the arrays or idk. Please could you take a look once more at it and tell me what might be the problem?