How to use multiple "Filter" in "For Each File in Folder" Activity?

How to use multiple “Filter” in “For Each File in Folder” Activity?
for example i want to filter file with extension .xlsx and .xls at the same time when get files in folder using “For Each File in Folder” Activity.

Hi @wija ,
Use + icon to add additional file format.

Regards,
Arivu

1 Like

ah, so the only way is by adding “IF” activity inside the “For each file in folder” activity?
so inefficient lol.

thanks for answering

1 Like

@wija “*.(.xlsx|.xls)”
Use this and let me know.

Thanks

It will not allow. will show error as illegal char error.

Regards,
Arivu

Hi @wija

You can try with this expression in the For each activity

Directory.GetFiles(Environment.CurrentDirectory+"\","*.*").AsEnumerable().Where(Function(a) New FileInfo(a).Extension.ToString.ToUpper.Contains(".XLSX") Or New FileInfo(a).Extension.ToString.ToUpper.Contains(".XLS")).Select(Function(d) d)


Regards
Sudharsan

thank you for answering, but the question is for “for each file in folder” activity.

1 Like

@wija Yes i Know , I think we cant do that in for each file in folder

Regards
Sudharsan

for now, only this solution is working but inefficient.

1 Like

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