How to read multiple invoices in subfolders

I want to read multiple invoices from sub folders please suggest better way
"C/users/main directory>>>8 subfolders
Each subfolder has number of invoices

1 Like

Hello @Poojitha

Plz watch the below video. If you get all the files details in an array, then use a for each activity to loop through the files .

1 Like

Hi @Poojitha,

You can get pdf files in all subfolders.

Directory.GetFiles(“Your file path”,“*.pdf”,SearchOption.AllDirectories)


have a look on the below referenced CheatSheet. You can use it for reference and for checking / training your skills

1 Like

I have to avoid one subfolder how can I do this

I have to avoid one subfolder from main directory


Hope the below steps would help you resolve this

  1. Use a assign activity like this

Where arr_filepath is a variable of type array of strings defined in variable panel

  1. Now use a FOR EACH activity and pass the above array variable as input and change the type argument as string in the property panel

  2. Inside the loop use a IF condition like this

item.ToString.Contains(“mention the sub folder path you want to neglect”)

if true the sub folder is found and goes to THEN so leave it simply empty
And if false goes to ELSE block where we need to proceed further so keep all the set of activities you want inside the ELSE block

Cheers @Poojitha

1 Like

you can filter our afterwards e.g.with a LINQ statement

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