Using CQWP or CSWP to match and return files with a variable site column value.

Craig St. Clair 21 Reputation points

I would like to use the content query web part or the content search web part to build a query for files in a specific library based on a tagged value of that library; here's the catch: I want the cqwp or cswp to return files when it matches a metadata variable on that page; so if a selected tag value for a specific site column on the page with the cqwp or cswp is "paul" I want the web part to return files from a specific library that are tagged with a specific site column value of "paul"

It feels like this should be possible, particularly in the content search web part. Thanks for any help.


SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
1,686 questions
{count} votes

Accepted answer
  1. Emily Du-MSFT 24,476 Reputation points Microsoft Employee

    @Craig St. Clair

    Here're steps:

    1.Create a list column in the document library.
    2.Go to Central administration -> Search service application -> Search Schema -> New Managed Property -> Click Queryable、Searchable、Retrievable, add the crawled property of newly created column as mapping.
    3.Start a full crawl.
    4.Go to the library -> Edit page -> Add content query web part.
    5.Edit content query web part -> In the Source, choose the specific library in the "Show items from the following list" -> In the Additional Filters, select the newly created column set filter.
    6.For example, after settings testcolumn is equal to 1, then file1 shows in the content query web part.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Most helpful