THE PROBLEM:
I got an UiPath.MicrosoftOffice365.Models.Office365Message.AttachmentCollection I want to insert as an IEnumerable
THE SCENARIO:
In a “Microsoft Office 365 Scope” I use the action “Get Mail” which output an “Office365Message[ ]”
Then I do a “For Each” loop where the “TypeArgument” is set as “UiPath.MicrosoftOffice365.Models.Office365Message”.
Now I want to use “Send Mail” (UiPath.MicrosoftOffice365.Activities.Mail.SendMail) and take all attachements (if any) from the “Get Mail” action and insert as “Attachments Collection”.
the attachmentCollection has items of the datatype: Attachment
the attachmentCollections from send Mail expects a List(Of String) with filepaths to the attachments saved on filessystem
to overcome you can save the attachments of the loop item and use later the file paths for the send Mail activity
We can use SaveAttachments activity in UiPath.Mail.Activities package even if variable type is Office365Message. And it returns IEnumerable<String>, as the following. We can use it in Attachment Collection property of SendMail activity.