How can I append office365 message to an array

I have a for each, which gets emails from different accounts.
I want to append all the emails into one array.

The “get email” activity has as output, an array of UiPath.microsoftoffice365.models.office365message. I’ve named it Output_Emails

Then I’ve also created an array called, Arr_Failed_Emails. It’s type is an array of UiPath.microsoftoffice365.models.office365message

What should I add in my assign, in the for loop to append the results each time it loops?

I’ve tried the following with no luck.
Arr_Failed_Emails = Arr_Failed_Emails.Append(Output_Email(Counter))

image

FYI - I was able to do this successfully with a datatable, however I want an implementation that uses solely arrays.

Added example of my approach
Main.xaml (14.9 KB)

Hi,

How about the following?

Arr_Failed_Items = Arr_Failed_Items.Concat(Output_Failed_Emails).ToArray

Sample
Main(16).xaml (18.7 KB)

Regards,

Many thanks. It worked, will mark it as a solution.

Would you know how to get a pdf from a replied email.
Thus its child.

Im getting all failed emails, that part works, and then I have to download the pdf that is in the original send email.

I’ve tried save attachment with filter “*.pdf” but that didn’t work. It gives me the following error “Save Attachments: Illegal characters in path.”

image

Hi,

This means illegal character such as colon or linebreak etc. is included in your path or filename. Can you share your path or filename when error occurs?

Regards,