none
Filtering library with query string

    Question

  • I'm trying to filter library items by tag using query strings and am hitting dead ends with all three methods I've found.

    Method 1: FilterField1=Tags&FilterValue1=Supervisor&FilterField2=Tags&FilterValue2=Manual

         This works but returns everything that matches either tag, I need it to only return items with both tags. 

    Method 2: FilterName=Tags&FilterMultiValue=Supervisor;Manual

         Returns the error Exception from HRESULT: 0x80131904

    Method 3: Added a Query String (URL) Filter webpart and use the query string Tags=Manual&Tags=Employee

          This one ignores the second term completely. The advanced filter options get greyed out as soon I connect it to the library.

    Any suggestions?

    Wednesday, February 1, 2017 7:08 PM

All replies

  • Hi Patrick Kelley - LAWV,

    How did you create tags column? What is the column type of the tags? How did the value display in tags column?

    If the tags column type is the Checkboxes (allow multiple selections), you could create a single line of text column named tags1 and copy the value in tags column to the tags1 column.

    Then the value in tags1 column will be display like “aa,bb”.

    If you want to filter both tags “aa,bb”, you could use the “FilterField1= tags1&FilterValue1=aa,bb”.

    Best regards,

    Sara Fan


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, February 2, 2017 9:40 AM
    Moderator
  • Sorry for the delayed response. The tags column stores taxonomy terms.
    Tuesday, February 7, 2017 2:26 PM
  • Hi Patrick Kelley - LAWV,

    If the tag column is the managed metadata column and allowed multiple values, then I apply the FilterName=Tags&FilterMultiValue=Supervisor;Manual to filter items, encounter the same error with yours.

    Then the workaround is in previous post. Create a single line of text column and copy value from managed metadata column to the single line of text column, then apply the FilterName=singlelineoftext&FilterMultiValue=Supervisor;Manual on the single line of the text column.

    Then you can filter the items which you want.

    Best regards,

    Sara Fan


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com


    Wednesday, February 15, 2017 10:05 AM
    Moderator
  • Can this be done automatically or will the value have to be manually copied to the text column?
    Wednesday, February 15, 2017 1:11 PM
  • Hi Patrick Kelley - LAWV,

    You could copy the value from one column to another column manually or programmatically.

    If you use workflow to copy the value from managed matedate column to single line of text column, the value in single line of text column will display as “testdept|6ef088ca-e60d-4128-8bf8-5de8146ad388;department|a1c84c98-5261-41ed-b245-b828ff4cf451” including other characters.

    Best regards,

    Sara Fan


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, February 16, 2017 2:27 AM
    Moderator