How to get the specific files from the dynamic directory


I am downloading the folders from GitLab, every time I need to search for the json files in the folders.
But the folder names may vary, sometimes directories will be having child directories, and again child directories might contain another directory.
Since the directory names are not static, how to get the json files. without navigating to the child directories.


If you know the root directory path, then try with this linq query with a IEnumerable variable in assign activity.

Directory.EnumerateFiles(strDesktop, "*.*", SearchOption.AllDirectories).Where(Function(s) Path.GetExtension(s).TrimStart("."c).ToLower().Equals("json"))