How to save attachment into a dynamic folder created via UIPATH

Hi All, I am trying to create folder dynamically based on the current month of the year, subsequently I wish to download the email attachment into the folder that I created periodically.

The error that I encountered is For Each: Object reference not set to an instance of an object.

Can any kind soul enlighten me how should I fix it?Main.xaml (10.1 KB)

Many Thanks!

Hi @Juliani_Luo !
When I opened the xaml, I found errors.
Would you mind telling me what were the activities that I am missing ? (or from which package)

@Hiba_B - Update the mail package …you can see the below activities there…


1 Like

Hi @Juliani_Luo

I can see the variable list_mail datatype is IEnumerable and not List< .mail.mailmessage>

1 Like

Hi ,

You have not given the variable list_mail in output of get outlook mail message that’s why its throwing exception please provide the variable in the activities output and try again


Thanks a lot @prasath_S , it works!

Happy to hear @Juliani_Luo mark as solution if it helps

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.