Problem with Path Exists

Hello all,
I would like to check whether a file exists, but this does not work.

The initial situation is the following Multiple Assign

File_Path= Directory.GetFiles(ExcelPath)
FileName_Array={“_3898.xlsx”,“_5058.xlsx”,“_6518.xlsx”}
filtered_Files=File_Path.Where(Function (x) FileName_Array.Any(Function (f) x.Contains(f))).toArray
File=0

The Path Exists activity says “File_Path.Where(Function (x) FileName_Array.Any(Function (f) x.Contains(f)))(File)”.

I query this value in a Flow Decision and always get the value “True” even though this file does not exist.
What am I doing wrong?

based on your variables from above

assuming we want to filter the retrieved Paths on filenames contained within the FileName_Array items we can do

Assign activity
LHS: FilePathsFiltered | String() - string array
RHS:

File_Paths.Where(Function (x) FileName_Array.Any(Function (f) x.toUpper.EndsWith(f.toUpper))).toArray

Thank you, the main problem was the read range activity. In the table, an entry was marked in colour and caused the error.

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