To select the specific folder based on Input value

Hi All,
Can anyone please help me to how to select the folder based on the EmpID(six digit number)
Count of the folder must be 30K count.
could you please suggest me the best approach to filter the specific folder.


If anyone suggest LINQ query method that could would be better.

Here am attach the image for Reference.

Thanks in Advance.
Anitha Anandhan.

What do you mean “select the folder?” You aren’t doing UI automation (ie click, etc) in Windows Explorer, are you? If you want to interact with folders and files there are activities for that.

Hi @Anitha_Anandhan

Try this:

Assign filteredFolders = (From folder In folderList
                         Let empIdPart = folder.Split("-"c).LastOrDefault()
                         Where empIdPart IsNot Nothing AndAlso empIdPart.Length = 6 AndAlso empIdPart.All(Function(c) Char.IsDigit(c))
                         Group By folder Into Group
                         Where Group.Count() = 30000
                         Select folder).ToList()

Output=System.Collections.Generic.List(System.Stting)

Hope it helps!!

Thank you…!

but here we are not able to found the folder Name Syntax
we need to search the six digit number alone.

Many Thanks,
Anitha Anandhan.

Hi @Anitha_Anandhan

Try this query:

Assign filteredFolders = (From folder In folderList
                         Let empIdPart = New String(folder.Where(Function(c) Char.IsDigit(c)).ToArray())
                         Where empIdPart.Length = 6
                         Select empIdPart).ToList()

Hope it helps!!

Hello @Parvathy

I tried it but getting error like Where is not member of char.

Many Thanks,
Anitha Anandhan.

Hi @Anitha_Anandhan

Try this:

Assign filteredFolders = (From folder In folderList
                         Let empIdPart = New String(folder.Where(Function(c) Char.IsDigit(c)).ToArray())
                         Where empIdPart.Length = 6 AndAlso empIdPart.All(Function(c) Char.IsDigit(c))
                         Select folder).ToList()

Regards

Hello @Parvathy
still facing the same error

Many Thanks,
Anitha Anandhan

Hi @Anitha_Anandhan

Could you share the screenshot of Folder structure and and workflow xaml .

Regards

Hi @Parvathy

I have attached the input folder structure in the top of the ticket,
In workflow also try to use the assign activity the output variable type was declared as you mentioned.
Output=System.Collections.Generic.List(System. String)

Many Thanks,
Anitha Anandhan.

Hi @Anitha_Anandhan

If possible could you share the workflow file.

Regards

Hello @Anitha_Anandhan ,
Why don’t you simply use “Folder Exist” and if the folder exist directly access the folder !

Hi @Anitha_Anandhan ,

Please find the attached xaml. In this xaml we check for the folder is aviliable or not and later we check the count of the files in a particular folder.

Note:- I wanted to provide some clarification regarding about counting files in a particular folder. My understanding is that in order to accurately navigate and retrieve the file count for a specific folder, it’s essential to use the full path.

Without the complete path, the system may encounter difficulties in locating the specified folder, leading to potential inaccuracies in the file count. Therefore, for precise results, it is recommended to provide the full path when requesting information about the files in a particular directory.

Still if you have any doubts please reach out to below link.
Link:- https://youtu.be/LHNWeyamat8(This video will pop out by 3-Jan-2024 5PM onwards)

Ragards,
Pavan Kumar/Techystack

To select the specific folder based on Input value Solution-No-10.xaml (9.1 KB)