0

I am using a custom list with standard OOB AllItems.aspx view using the modern experience. (NOT a web-part, NOT the classic experience)

When I filter using

.../AllItems.aspx?FilterField1=MyTextColumn&FilterValue1=MyVal

it works fine and I see only rows containing MyVal.

When I filter using

.../AllItems.aspx?FilterName=MyTextColumn&FilterMultiValue=MyVal

or

.../AllItems.aspx?FilterName=MyTextColumn&FilterMultiValue=MyVal;YourVal

The list view acts as if no filtering was applied - all rows are displayed.

Ultimately the column I want to select on is "Single Line of Text" but I have gotten the same results using "Choice" and "Person or Group" and "Yes/No" as well. They work fine with FilterField1/FilterValue and they ignore FilterName/FilterMultiValue.

  • Is there some special configuration I have to do for SPO to allow for filtering by multi-values?
  • Is this a feature that works only with list web-parts and not with standard list views?
  • Is this a feature that is no longer supported? (Most of the references I've read are from 2010-2014)...
  • Am I mistaken in my understanding of how this should work? Should I be able to directly replace FilterField1/FilterValue1 with FilterName/FilterMultiValue and have it work identically?

I have checked about 20 times to make sure I have correct case and spelling on FilterName/FilterMultiValue and I have even tried (as I've seen on a couple sites) FilterField1/FilterMultiValue1 and various other permutations.

Perhaps unrelated but FilterOpX is being ignored as well. I saw several comments that this was a difficult-to-reproduce problem that occurred on some sites/lists and not on others...

  • What is the data type of your Column/field? – Ganesh Sanap Aug 19 at 13:38
  • Ultimately I want to apply it to a "Single Line of Text". When that didn't work I tried it on some other types (most recent a "People") and get the same result where FilterField1 works but FilterName is ignored. – Peter Bowers Aug 19 at 13:51
  • Added my answer below. I can't mark it as the right answer because stackexchange doesn't trust me on the sharepoint site, but you can still view it. – Peter Bowers Aug 19 at 15:38
  • If someone comes up with a solution how to use FilterMultiValue (with * as wildcard) I'm still very interested. – Peter Bowers Aug 19 at 17:34
0

You need to use the Filter in below format:

.../AllItems.aspx?FilterFields1=MyTextColumn-FilterValues1=MyVal;#YourVal

Note ;# as a separator between two values.

  • As soon as I put myval;#yourval in the URL then it redirects to a simple AllItems.aspx URL without any query parameters at all. In other words, it redirects to a URL without the ? or the & or any of those Filternnn values. I am familiar with using ";#" as a separator between the ID and the label in a person or metadata field; if that is what you were attempting to do that is NOT what my question is about. – Peter Bowers Aug 19 at 14:22
0

So apparently the

useFiltersInViewXml=1

query parameter is a thing. Maybe just in SPO or maybe just in Modern Experience. I'm finding ZIP in terms of documentation from M$, but when I add that into my query:

.../AllItems.aspx?FilterName=MyTextColumn&FilterMultiValue=MyVal;YourVal&useFiltersInViewXml=1

then all of a sudden the world is my oyster...

Hope this helps someone else. If someone sees someplace where this is decently documented please comment below.

---EDIT---

My oyster ended up without a pearl. It works beautifully at first but some random number of seconds after that SPO does a reload via AJAX which ignores the filters I have specified.

TRY AGAIN:

This time I went into the unfiltered view, filtered by the columns I'm interested in, and reverse engineered the resulting URL. I end up with a query that looks like this:

.../AllItems.aspx?FilterFields1=MyTextColumn&FilterValues1=MyVal%3B%23YourVal&FilterTypes1=Text

Note that I have changed the URL as follows:

  • FilterFields1 instead of FilterName
  • FilterValues1 instead of FilterMultiValue
  • separating my multi-values with %3B%23 (which is ;# encoded)
  • added the FilterTypes1=Text query parameter for this "Single Line of Text" column type
  • no longer using useFiltersInViewXml=1

Some "Gotchas" to be aware of:

  • If your dynamic query sometimes allows multi-values and other times has only a single value you must change your URL (FilterField1 and FilterValue1 without the s)
  • FilterTypes1=Text will change based on column type - manually filter and examine the resulting URL to figure out what you need
  • While FilterName/FilterMultiValue supported (or was supposed to support) * as a wildcard, this is not supported here with this syntax
  • I'm testing this only on Sharepoint Online as of Aug-2019 - YMMV elsewhere

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.