Email Parser - filtering multiple attachments
Status: Open · Asked by Shane Harris on · 0 views
I have a specific notification email that is received into an outlook inbox I need to take the attachment from and send to Chat GPT for data extraction. The issue is, this notification email always has multiple PDFs attached, but I only need to send one to ChatGPT (the attachment always contains the text 'ContractNote' in the file name).
Is there a way to get all the attachments that are received in a single response by the email parser, determine which one is the one that needs to be processed, and only send that one to ChatGPT?
Hi @shane6836,
Thank you for reaching out.
Yes, this can be achieved.
You can capture all attachments using the Email Parser in Advanced Response format so that you receive them as an array. Then:
- Add an Iterator to process each attachment.
- Use a Filter step to check the attachment file name (e.g., contains ContractNote).
- Only allow the matching attachment to pass through.
- Send that filtered file to ChatGPT for processing.
This way, even if multiple PDFs are received, only the required one will be processed.
Please try this setup and let us know how it goes.
Hi @shane6836,Thank you for reaching out.
Yes, this can be achieved.
You can capture all attachments using the Email Parser in Advanced Response format so that you receive them as an array. Then:
- Add an Iterator to process each attachment.
- Use a Filter step to check the attachment file name (e.g., contains ContractNote).
- Only allow the matching attachment to pass through.
- Send that filtered file to ChatGPT for processing.
This way, even if multiple PDFs are received, only the required one will be processed.Please try this setup and let us know how it goes.
I ended up using text formatter to extract the specific part I needed, as the email always comes with the same attachments (and unless something changes, this appears like it will work).
But i can see that using an iterator with a filter would be a lot more flexible and could help account for any changes to how the provider sends across the info - will have to have a play with this option
Thanks so much for your guidance - as always it is very much appreciate!!!
Thank you for the update. As long as the attachments appear in the same manner in your email, the Text Formatter should also work. Please monitor your workflow for some time, and if you encounter any issues, do let us know and we will guide you further.
Thanks & Regards,
Arshil Ahmad
Customer Support Associate
? Pabbly.com
?Rate your support