Forum Discussion
My-atix
Sep 05, 2020Copper Contributor
Highlighted Content WebPart and Managed Property Filter HELP
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 WebPar...
Susan_Hanley
Sep 06, 2020MVP
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.
pointconsulting
Sep 06, 2020Copper Contributor
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. 🙂
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. 🙂
- Susan_HanleySep 06, 2020MVPThanks 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.
- myatixSep 07, 2020Copper Contributor
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>- Susan_HanleySep 07, 2020MVPTry 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.