Question Regarding Directory.GetFiles Using a String Array Variable

I have a variable called arrayAttachments. It is of type string array (system.string)
I also have a variable called strAttachmentPath. It is of type string with a default value of a local folder path (C:\attachments)

I’m using an assign activity like below:
arrayAttachments = Directory.GetFiles(strAttachmentPath)
I’m curious how this assign activity above works? Is it getting all of the files in the local folder?

Next there is a flow decision with the condition: arrayAttachments.Count = 0
What does this condition mean exactly? I’m trying to determine for my True/False activites.

Thanks!

Hi,

I’m using an assign activity like below:
arrayAttachments = Directory.GetFiles(strAttachmentPath)
I’m curious how this assign activity above works? Is it getting all of the files in the local folder?

Yes. We can get all the full filenames in the folder as string array basically.

Next there is a flow decision with the condition: arrayAttachments.Count = 0
What does this condition mean exactly?

It means if number of items in the array is zero (there is no file in the folder), branch to true side. If condition does not meet (there is one or more items in the folder), branch to false side.

Regards,

4 Likes

Thank you @Yoichi! Much appreciated.

1 Like

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