You can directly use this LINQ expression in the condition of the ‘If’ activity:
Directory.GetFiles("\epic-nas.et1157.epichosted.com\xfr\nonprd\toODB\Claims\PBClaims\CRD\TEST1\archive\").Any(Function(file) Path.GetFileName(file.ToString).StartsWith("EPICTRAN_" + Today.ToString("yyyyMMdd")) AndAlso Path.GetExtension(file.ToString).Contains("txt"))
This LINQ retrieves all files in the specified path and checks if any of them start with the desired naming format while ensuring the file extension is .txt. It returns a boolean, making it suitable for use directly in the condition part of the ‘If’ activity.
For example:
Directory.GetFiles([YOUR_FOLDER_PATH]).Any(Function(file) Path.GetFileName(file.ToString).StartsWith([FIXED_PART_OF_THE_NAME]) AndAlso Path.GetExtension(file.ToString).Contains([EXTENSION]))
Here’s a screenshot of a found case:
Not found case:

