Forum Discussion
Highlighted Content WebPart and Managed Property Filter HELP
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. 🙂
- 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.
- myatixSep 07, 2020Copper Contributor
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-part-allow-multiple-fil%C2%A0