Not Able to Convert Current Item to IEnumerable In a For Each Loop

Hi,

I am creating a workflow wherein for each file in the folder I will have to trigger the Send SMTP Mail Message activity which means if i have three files in the folder, then three separate mails have to be triggered with that particular file attached to the SMTP Mail Message.

Waht the issue I am facing is that though my Get Files output is an IEnumerable type but the For Each “File” is only a system.String which i am not able to attach because SMTP Mail Message accepts only IEnumerbale in the AttachmentsCollection Field in the property panel.

Suggest me a solution.

Hi,

Can you try the following?

Attachements property

OR

AttachmentCollection property

Regards,

HI Yoichi,

Thanks for your support.

Attachments Property I passed File - It is working.
AttachmentCollection Property I passed {File} - It is not working. Throwing Error.

Thanks for your solution. It worked.

Hi,

Do you use C# mode? if so, the following will work.

new string[] {item}

Regards,

Hi Yoichi,

My Project is in VB Mode.

Hi,

Can you share message of the exception?

Regards,

Hi,

Find the details below.

image

Hi,

Can you check content of file variable at LocalsPanel when workflow stops due to exception?

Regards,

Hi Yoichi,

THis is the content of the File Variable in the locals panel.

Hmm…

Can you check if there is argument field in Attachment property as the following? If there is, please delete this argument field.

img20211115-5

Regards,

Hi Yoichi,

Great. It worked. Thanks a lot for your support.

Out of curiosity i am asking what does the {} mean for an IEnumerable field. Please explain me. Thanks In Advance.

Hi,

{} means array in VB. it implements IEnumerable.

Regards,

Thank YOu Very Much For the Information.

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