In this post, we will get all the files present in a folder and print their path on the output panel. First, we will store the files in an array of string and then we iterate through the array.
Prerequisites
Add a new assign activity. Create a new variable by pressing Cntrl+K. Name the variable listOfFiles. Give the value of variable as below –
Directory.GetFiles("<Your Folder Path>")
You will notice an error because we need to change the variable type to System.String[]. Open the variables panel and change the type.

Advertisement
Add a For Each activity and iterate through the list of files and print their path on the console using the Writeline activity. You will have to change the item/file to string in order to print.

Your complete flow looks like this.

Run the process and check the output.

Thank you All!!! Hope you find this useful.
Advertisement
0 comments