I need to save email attachments only if the following conditions apply for the If statement:
“listMailmsg(N).Attachments.Count>0” AND
the attachments need to be only of type “.pdf”
I don’t know what is the syntax to check that the filename for the attachment is “.pdf”
N is a counter for a loop which needs to go through a list of mail messages and save only pdf files for VALID EMAILS to a folder OR if there are no attachments or a VALID EMAIL then it needs to send out a message informing the user that there is no attachment.
The workflow is not working at the moment though I will attach it, I just need to specify these two arguments for the “If” statement.Main.xaml (90.9 KB) project.json (985 Bytes)
When you save the atachments, you receive as output a “IEnumerable” where every single value is a Complete path of every single File. So you can ask in the If (inside a for each item): attachment(0).EndsWith (“.pdf”)
Is there no other way to do this because the “Else” part of the “If” is also quite important as it needs to send out an error email to the client if there has not been a “.pdf” attachment found? So if I only have the “listMailmsg(N).Attachments.Count>0” as the argument then it does not execute the else part where for instance it finds a “.png” attachment (being a logo, etc.) btw why does Ui Path not just save the actual attachment only? Why is it saving things on the email that have not been directly attached?