Not working this method

Continuing the discussion from How to get the filename of attachment?:

Hi @acaciomelo

the above mentioned method doesn’t works for me i am trying to accessing the single attachment from each mail and trying to get the name of the attachment. but it shows me the error of
“Assign: Object reference not set to an instance of an object.”

i am assigning the attachment name to a string and also converting from mail messages to string.
kindly help me out from this. Here I am attaching the screen short.

if you are using Get Exchange Mail Activity check in properties if GetAttachments is checked

Check suggestion by @AdityaVN

Or if you are using Get outlook mail message then you must be using the for each activity…
So before using assign add one if activity with condition mailItem.Attachments.Count>=0

If greater than 0 then assign the name or else skip the email

thank you for the quick response,
Actually i am using the Get IMAP Mail Message Activity.

Add the condition asked by me once and see

Already checking that condition too @Pravin_Patil1
if Subject contains the word AND Mail Attachment isNot Nothing then only it will save the attachment. It can able to satisfy the condition and able to Save the attachment at tho destination folder.

find the attachment below.

and also i can able to get the complete path of the File which i have downloaded at the save attachment activity output list.

i just want to know the name of the file before downloading so that i can change or rename the file name if the same file name already exist at the destination folder.