SharePoint Online: How to Add a Custom Property to Advanced Search Properties Drop-Down?

Requirement: Add a new property to the advanced search drop-down in SharePoint Online.

SharePoint Online: How to Add a Property to Advanced Search Drop Down?

To perform search queries based on a specific column value in SharePoint, we can use “Advanced Search”. By default, you can search against any managed property, such as “Author:Some Name” in SharePoint. SharePoint Online advanced search properties drop-down with default values such as “Created by”, “Name”, “Size”, etc. To add your custom column to this drop-down, follow the below steps:

Step 1: Get the Managed Property to add to advanced search properties
We need the metadata column created as a managed property in order to list it in the advanced search page properties drop-down. Unlike SharePoint On-premises, SharePoint Online automatically creates a managed property for Site Columns during crawling if the column has values in it!

sharepoint online search get managed property

Edit the automatically created managed property to map additional fields and set an alias for the managed property. You may have to create a new managed property by mapping existing crawled properties, if not listed on this page.

Step 2: Edit Advanced Search page and Add Managed Property to the Schema

The Properties popup page gives XML schema for all properties listed on the Advanced search page. Copy-paste it to any XML editor as it would be easier. Here I’ve copied the schema to an XML file, opened it in “SharePoint Designer” and re-formatted the code for better usability.

Add the entries to <PropertyDefs> and in <ResultTypes><ResultType> nodes

sharepoint online add custom property to advanced search drop down

Now, You should see the new column added to properties drop down in Advanced Search page!

sharepoint online advanced search add property restrictions

Wait for the “Crawl” to run on your SharePoint Online site (or reindex the list or library manually), and you can perform search queries based on the custom property.

Here is another article for SharePoint On-Premises: Adding Custom Properties to SharePoint Advanced Search

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

One thought on “SharePoint Online: How to Add a Custom Property to Advanced Search Properties Drop-Down?

  • Great post, how do I edit the ” Edit Advanced Search page” / “advanced.aspx” of a search sub-site?

    Reply

Leave a Reply

Your email address will not be published.