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.
- pointconsultingSep 06, 2020Copper ContributorHi 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. 🙂- 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>
- pointconsultingSep 06, 2020Copper ContributorHi 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?