Sometimes we need to set filter in Sharepoint list view on the hidden field. As hidden fields are not shown in UI we can’t set such filters from the browser, but we can set them programmatically. E.g. suppose that we have field “IsPrivate” which is hidden so end users are not able to change value of this field and we want to show only non-private list items in the list view. List view filter will look like this in this case:
Now if we will try to modify this list view in UI we will see that its filter section looks like there is no filter at all:
And which is more interesting is that when we will click Save button there – filter on hidden field will remain. I.e. if we will add sorting from UI ViewQuery property will look like this:
even though Filter was shown empty in UI. Be aware of this tricky moment to not be confused in situations when filter uses hidden fields.