You are viewing limited content. For full access, please sign in.

Question

Question

Find only folders that have subfolders

asked on July 24, 2014 Show version history

Is there a way to find a folder that's name will be unknown but has subfolders.  It is somewhat confusing but here is an example of what I mean.

 

 

Student Records\Active\A\Student Name\Subfolder.

 

I want to be able to find only Student Name folders that have subfolders in them.

 

Any help with this would be appreciated.

 

Thanks.

0 0

Answer

SELECTED ANSWER
replied on July 24, 2014 Show version history

You can do this using the search syntax LF:ChildName. LF:ChildName returns all folders that contain entries than satisfy the parameter of LF:ChildName. For your case, I would wildcard ChildName search for folders and a within folder search.

 

For example, to search within the folder A for student folders that have a subfolder (where the structure is Student Records\Active\A\<Student Name>\<subfolders>, you would perform the following search:

({LF:LOOKIN="Student Records\Active\A", SUBFOLDERS=0}) & {LF:ChildName="*", Type="F"}

Note that I have included SUBFOLDERS=0. I am assuming you only wish to return the student's folders, and not return the subfolders of those student folders. You can omit this if that assumption is incorrect.

 

Furthermore, note that I included Type=F in the ChildName part of the search, which means student folders that only contain documents and shortcuts and not any subfolders will not be returned.

 

Finally, if you wish to search on multiple folders at once (say, A and C), you could combine folders using | (the OR operator):

({LF:LOOKIN="Student Records\Active\A", SUBFOLDERS=0} | {LF:LOOKIN="Student Records\Active\C", SUBFOLDERS=0}) & {LF:ChildName="*", Type="F"}
2 0

Replies

replied on July 24, 2014 Show version history

Thanks!  Now looking at your syntax I don't know why my other team member and I didn't realize it sooner.  Our syntax was almost identical but we forgot to include the Type="F" when referencing the Childname.

0 0
replied on July 24, 2014

It happens wink ChildName actually defaults to searching for child documents only, so if you don't include the Type=F, you would definitely be missing some of the folders you wanted to return.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.