Highlighted Content WebPart and Managed Property Filter HELP

%3CLINGO-SUB%20id%3D%22lingo-sub-1638937%22%20slang%3D%22en-US%22%3EHighlighted%20Content%20WebPart%20and%20Managed%20Property%20Filter%20HELP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1638937%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20hoping%20someone%20might%20be%20able%20to%20assist%20with%20a%20little%20challenge%20I%20have%20been%20fighting%20with%20in%20a%20SharePoint%20Online%20Communication%20Site.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EScenario%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20use%20a%20Highlighted%20Content%20WebPart%20with%20metadata%20from%202%20Site%20Columns%20(Term%20Store)%26nbsp%3B%20in%20a%20page%20library%2C%20to%20filter%20the%20content%20from%20multiple%20site%20collections%20in%20the%20Highlighted%20Content%20WebPart%20.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20created%202%20Custom%20Site%20Columns%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3E%3CSPAN%3EBusinessFunction%3C%2FSPAN%3E%3C%2FLI%3E%3CUL%3E%3CLI%3E%3CSPAN%3ESales%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EMarketing%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3ETechnical%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CLI%3E%3CSPAN%3EBusinessRole%3C%2FSPAN%3E%3C%2FLI%3E%3CUL%3E%3CLI%3E%3CSPAN%3EDirector%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EDept.%20Manager%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3ESales%20Rep%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3E%3CSPAN%3EEmployee%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBoth%20site%20columns%20are%20%22Managed%20Properties%22%20in%20the%20tenant%20search%20scheme%20and%20I%20am%20able%20to%20filter%20content%20from%20a%20single%20Site%20Column%20by%20using%20a%20filter.%20However%20things%20get%20a%20little%20strange%20when%20I%20add%20the%20second%20column%20into%20the%20filter.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20business%20roles%20have%20a%201%20to%20many%20relationship%20with%20the%20business%20function.%3C%2FP%3E%3CP%3EIE%3A%20Marketing%2C%20Sales%20and%20Technical%20all%20have%20a%20Director%20Role.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EQuestion%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EIs%20there%20a%20simple%20way%20to%20setup%20the%20Highlighted%20Content%20filter%20to%20query%20the%20site%20columns%20within%20the%20Highlighted%20Content%20webpart%20so%20I%20%3CU%3EONLY%3C%2FU%3E%20return%20items%20related%20to%20for%20example%3A%20Sales%20Director%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20setup%20the%20below%20filters%20on%20the%20webpart%20I%20would%20expect%20to%20only%20retrieve%20the%20Sales%20Director%20information%20that%20has%20been%20tagged%20with%20the%20BusinessFunction%3A%20Sales%20and%20BusinessRole%3A%20Director%E2%80%A6%20But%20I%20don't%3F%3F%3F%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EFilters%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EowstaxidBusinessFunction%3C%2FP%3E%3CP%3EDoesn't%20Contain%3C%2FP%3E%3CP%3EMarketing%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EowstaxidBusinessFunction%3C%2FP%3E%3CP%3EDoesn't%20Contain%3C%2FP%3E%3CP%3ETechnical%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EowstaxIdBusinessRole%3C%2FP%3E%3CP%3EContains%3C%2FP%3E%3CP%3EDirector%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20please%20assist%20me%20on%20how%20this%20can%20be%20achieved%20it's%20driving%20me%20crazy.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1638937%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1639554%22%20slang%3D%22en-US%22%3ERe%3A%20Highlighted%20Content%20WebPart%20and%20Managed%20Property%20Filter%20HELP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1639554%22%20slang%3D%22en-US%22%3EHave%20you%20tried%20Filter%20owstaxidBusinessFunctions%20contains%20Sales%20and%20a%20second%20filter%20owstaxidBusinessRole%20contains%20Director%3F%20With%20two%20separate%20filters%2C%20the%20filters%20will%20have%20an%20implied%20AND%20and%20you%20should%20retrieve%20content%20for%20Sales%20AND%20Director.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1639744%22%20slang%3D%22en-US%22%3ERe%3A%20Highlighted%20Content%20WebPart%20and%20Managed%20Property%20Filter%20HELP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1639744%22%20slang%3D%22en-US%22%3EHi%20Susan%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20for%20the%20reply%20and%20let%20me%20take%20a%20second%20to%20say%20that%20I%20love%20the%20Governance%20session%20you%20have%20done%20at%20Ignite%20in%20the%20past.%3CBR%20%2F%3E%3CBR%20%2F%3EWith%20regards%20to%20your%20response!%20Unfortunately%20if%20I%20create%20the%20filter%20you%20suggested%20it%20returns%20all%20posts%20marked%20with%20Sales%20%26amp%3B%20all%20posts%20marked%20with%20Director.%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20I%20would%20get%3A%3CBR%20%2F%3EAll%20OwstaxidBusinessFunction%20marked%20with%20Sales%20and%20all%20owstaxidBusinessRole%20marked%20with%20Director%3CBR%20%2F%3E%3CBR%20%2F%3EExample%20of%20results%3A%3CBR%20%2F%3ESales%20Director%3CBR%20%2F%3ESales%20Dept.%20Manager%3CBR%20%2F%3ESales%20Employee%3CBR%20%2F%3EMarketing%20Director%3CBR%20%2F%3ETechnical%20Director%3CBR%20%2F%3E%3CBR%20%2F%3EI%20only%20want%20to%20return%20Sales%20Director%20posts.%20Any%20Ideas%3F%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
New Contributor

I am hoping someone might be able to assist with a little challenge I have been fighting with in a SharePoint Online Communication Site.

 

Scenario:

I am trying to use a Highlighted Content WebPart with metadata from 2 Site Columns (Term Store)  in a page library, to filter the content from multiple site collections in the Highlighted Content WebPart .

 

I have created 2 Custom Site Columns:

 

  • BusinessFunction
    • Sales
    • Marketing
    • Technical
  • BusinessRole
    • Director
    • Dept. Manager
    • Sales Rep
    • Employee

 

Both site columns are "Managed Properties" in the tenant search scheme and I am able to filter content from a single Site Column by using a filter. However things get a little strange when I add the second column into the filter.

 

The business roles have a 1 to many relationship with the business function.

IE: Marketing, Sales and Technical all have a Director Role.

 

Question:

Is there a simple way to setup the Highlighted Content filter to query the site columns within the Highlighted Content webpart so I ONLY return items related to for example: Sales Director?

 

When I setup the below filters on the webpart I would expect to only retrieve the Sales Director information that has been tagged with the BusinessFunction: Sales and BusinessRole: Director… But I don't????

 

Filters:

owstaxidBusinessFunction

Doesn't Contain

Marketing

 

owstaxidBusinessFunction

Doesn't Contain

Technical

 

owstaxIdBusinessRole

Contains

Director

 

Can anyone please assist me on how this can be achieved it's driving me crazy.

8 Replies
Have you tried Filter owstaxidBusinessFunctions contains Sales and a second filter owstaxidBusinessRole contains Director? With two separate filters, the filters will have an implied AND and you should retrieve content for Sales AND Director.
Hi Susan,

Thank you for the reply and let me take a second to say that I love the Governance session you have done at Ignite in the past.

With regards to your response! Unfortunately if I create the filter you suggested it returns all posts marked with Sales & all posts marked with Director.

So I would get:
All OwstaxidBusinessFunction marked with Sales and all owstaxidBusinessRole marked with Director

Example of results:
Sales Director
Sales Dept. Manager
Sales Employee
Marketing Director
Technical Director

I only want to return Sales Director posts. Any Ideas?
Hi Susan,
First let me say how much I loved you Governances guidance and sessions you have done.

To answer your question yes I have:

It returns all Sales posts no matter the owstaxidBusinessrole and all Director posts no matter what the owstaxidBusinessFunction is.

Example results:

In other words all posts with the below metadata.

Sales Director
Sales Dept. Manager
Sales Sales Rep
Sales Employee
Marketing Director
Technical Director

Any other ideas would be gratefully appreciated. :)
Thanks for your kind words. If you want to ensure the AND query and that is not what you are seeing, you will probably need to use the custom query option. The syntax is more complicated but you should be able to get exactly what you want.

Ya I have also tried that but CAML queries don't appear to work at present and KQL only supports queries on the current site collection as far as I can see. :( The whole query/ filter functionality seems very flaky at the moment.

 

The question is why doesn't "Doesn't contain" work as expected. ;) This appears to be a bug as does the fact that the webpart says you can use either CAML or KQL but CAML isn't working.

 

Or perhaps I am doing something incorrect?

<Query>
<Where>
<And>
<Contains>
<FieldRef Name='Function' />
<Value Type='TaxonomyFieldType'>Sales</Value>
</Contains>
<Contains>
<FieldRef Name='BusinessRole' />
<Value Type='TaxonomyFieldType'>Director</Value>
</Contains>
</And>
</Where>
</Query>

 

 

Try using this tool to build your query: https://github.com/pnp/PnP-Tools/tree/master/Solutions/SharePoint.Search.QueryTool. I'm not a pro - I usually get help for queries - but this is a good place to start.

@Susan Hanley 

 

I thought I should point out this is an issue that over 900 others are fighting with according to uservoice. I am happy I am not going mad... ;) It would appear this is a major problem with the way that the filter functionality has been implemented in the "Highlighted Content" and "New" webparts. Please read the uservoice suggestion for further details.

 

But to cut it short if you use multiple columns and refer to the same column twice it acts as an OR not and AND statement, making it very difficult to implement a filter that subtracts results.

 

Please vote for this if you are also having the same issue. (See link below)

https://office365.uservoice.com/forums/264636-general/suggestions/32071210-highlighted-content-web-p...

 

Yes, if you filter for the same value, the implied operator is OR. If you filter for different values, I get an AND experience when at least one of the values are not my custom properties. You are correct, though. I reported the same concern in a blog post in 2018. That is why you will want to use the KQL or CAML query to mitigate the issue. Unfortunately, it's just way more complicated.