How can i combine the results of 2 "Get Mail"

I need to combine 2 sets of emails that i grabbed using “Get Mail” from outlook. One is capturing emails from the inbox and the other from drafts.

How can i combine them in an array or group together so that i can run a for loop on each item afterwards.

Package used: UiPath.MicrosoftOffice365.Activities

Hi @NiesonF

You can use the Concat() function

FullList = list1.Concat(list2).ToList

You must initialize the FullList first.

Assign Activity
arrCombined | DataType: Mail Array =
Failed_Emails.Concat(Draft_Emails).toArray

then it can be used e.g. within for each for looping
(with toList, we would do it, if List(of X) is preferred)

UPD1 - more details on: Mail Array
Mail Array in your above case:
grafik

UiPath.MicrosoftOffice365.Models.Office365Message[]

For more info about LINQ have a look here:

Thanks man. The solution was perfect.

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