Hello ,
I am trying to download all attachments from an email using IMAP (NOT Gmail and not Outlook)
I get an error : Save Attachments/Message : Value cannot be null/ System.ArgumentNullException
The strange thing is that it does download some of the attachments from some of the emails but it doesn´t finish the process I get this error.
Not sure if this error is received when an email doesn´t have an attachment . If yes what should I do so that the process omits these exceptions ?
This is the process and the error
Are you sure that “Attachments” is initialized to an empty list when there are no attachments, rather than being just plain null? Can you try currentItem.Attachments IsNot Nothing?
The process I run involves a subfolder “Inbox/Factura”.
The strange thing is that if I run it to the main folder “Inbox” and not to the subfolder I don´t get this error . It doesn´t make any sense
Agreed with this approach, and in particular you might want to check whether the attachments have some weird characters in the file name (you never know).
I have the same problem. When I looked into the mail message I saw that Studio recognize 2 attachments even if the email has only one. The first one is an empty attachment (Null name and also content)
The error is Save Attachments: Value cannot be null. (Parameter 'path2')
I already try to put some conditions to limit null attachments but without success.
If there is no attachments in the mail it will throw that error.
To handle this error first check the mail has attachments.
In if condition write like this
Mailmessagevariabe.Attachements.Any
The email has only one PDF document attached, but Studio find 2 attachments: 1 null attachment and the PDF file.
I already did the Attachment condition but I have the same error.
Also I tried to loop through attachments and save only the PDF file with the same result. Unfortunately I’m new user and I cannot attach screenshots.
In the Read CSV activity you are using the Path_CSV variable, Please use a assign activity to assign complete file path value. I can see in the screenshot shared by you Path_CSV value is null.