Question

I have a library with a few folders in it, and the files in the folder have a "Status" property and an "Assigned To" field.

I want to make a view with the following logic:

If (Content Type == Folder) OR ((Status == "Blah") AND (Blah Status Assigned To == [Me]))

so that when I email a link to the pre-filtered library, the user can see the folders in the root of the library, but also only see the files he's assigned.

I've tried setting up the view's filters as "Assigned To" AND "Status" OR "Content Type", as well as the other way around to try and work with SP's order of operations, but neither seems to work.

Basically I want a View to show files of a given criteria, AND all folders. Is what I'm trying to do possible just using the basic filters?

Was it helpful?

Solution

SharePoint CAML queries work in pairs when it comes to filtering and I am fairly certain that the out of the box list view filters work in the same way and are probably CAML behind the scenes. When working with the pairings, I believe SharePoint always groups the top most items first.

Using your example I was able to get what I thought was the expected result using

Assigned To = [Me] AND Status = Blah OR ContentType = Folder

because it naturally combines the first two.

If you are comfortable reading XML / CAML I would check out U2U Caml Query Builder and see how it orders things which should hopefully help you understand how it is all working behind the scenes so that you can get a better handle on out of the box filtering when it comes to larger and more complex filters.

Let me know if you are not seeing what you expect with that and if so, please explain in more detail what you are seeing that you aren't expecting.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top