I want to delete all the documents in all sub folders inside a parent folder. Can someone please let me know how do I do that in Workflow please? Thanks.
Question
Question
Delete all documents in Folders
Replies
You can use this advanced search
{LF:Name="*", Type="DB"} & {LF:LOOKIN="%(RepoAddressRoot)"}
This will find all documents under the path represented by %(RepoAddressRoot) and it will include its subfolders. Then you can just loop through the entries of the result set and delete them.
This looks like a one-time action since you seem to want to delete all documents from the repository, so it will be more efficient to do it from the Client or Web Access.
Will the below Advanced syntax find all the sub folders within a folder please?
({LF:Name="*", Type="F"} - {LF:ChildName="*", Type="D"} -{LF:ChildName="*", Type="F"})& {LF:LOOKIN="%(RepoAddressRoot)\"}
The token %(RepoAddressRoot) has a value of the top level folder.
Thanks
Priya
This syntax will return all the empty folders directly within the RepoAddressRoot folder: {LF:Name="*", Type="F"} looks for all folders, but then you specify that they should not contain any documents - {LF:ChildName="*", Type="D"} or any folders -{LF:ChildName="*", Type="F"} .
I recommend Alex's syntax if you want to find all of the documents themselves and not return any folders, which is probably the most effective way to handle the deletion assuming you want to delete just the documents and not the folders.
To return all the folders and subfolders (and not return the documents): {LF:Name="*", Type="F"}&{LF:LOOKIN="%(RepoAddressRoot)"}
To return all non-empty folders and subfolders (and again, not the documents themselves): {LF:ChildName="*", Type="BDFS"}&{LF:LOOKIN="%(RepoAddressRoot)"}
Thanks so much.
Priya