How to initialise a MailAddressCollection variable?

I am trying to read my company email inbox, and add the senders’ email addresses of all external emails, to a MailAddresCollection variable. When I use the Add To Collection activity, I have configured the following:

  • Item: mail.From
  • Type of argument: Mail.MailAddress

I have also created a new variable of MailAddressCollection type called collectionExternalEmailAddress, and set the Add To Collection activity’s Collection to collectionExternalEmailAddress. However, every time I run the script I get “The property ‘Collection’ of ‘Add to collection’ is not initialized”

How do I initialise a MailAddressCollection variable? Or how can I set the default value for a MailAddressCollection variable?

Thank you!

1 Like

In assign:
collectionExternalEmailAddress = new MailAddressCollection()
Works fine adding MailAddress objects to it after that.

1 Like

Thank you so much! Works like a charm :slight_smile:

Hi! I’m having the same issue, but with an ICollection variable. What should I do?

1 Like