Modern Experience: Highlighted Content - filter for two "and" connected managed properties

%3CLINGO-SUB%20id%3D%22lingo-sub-260132%22%20slang%3D%22en-US%22%3EModern%20Experience%3A%20Highlighted%20Content%20-%20filter%20for%20two%20%22and%22%20connected%20managed%20properties%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-260132%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EModern%20Experience%20sites%20provide%20the%20%22Highlighted%20Content%22%20web%20part%20for%20dynamically%20filtering%20content.%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EFiltering%20works%20like%20this%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3ETitle%20contains%3A%20project%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3ECreated%20by%20is%3A%20John%20Doe%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EManaged%20Property%20PercentageComplete%20contains%3A%20100%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EIf%20you%20select%20different%20filters%2C%20they%20are%20connected%20by%20%22AND%22.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EBut%3A%20If%20you%20select%20a%20filter%20twice%20it%20gets%20connected%20with%20%22OR%22.%20That%20makes%20sense%20in%20this%20example%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3ETitle%20contains%3A%20project%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3CSTRONG%3EOR%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FSTRONG%3ETitle%20contains%3A%20order%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3ECreated%20by%26nbsp%3Bis%3A%20John%20Doe%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EManaged%20Property%20PercentageComplete%20contains%3A%20100%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EBut%20if%20you%20need%20to%20filter%20on%20two%20Managed%20Properties%20you%20struggle%20with%20this%20limitations%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3ETitle%20contains%3A%20project%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3ECreated%20by%26nbsp%3Bis%3A%20John%20Doe%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EManaged%20Property%20PercentageComplete%20contains%3A%20100%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CSTRONG%3EOR%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FSTRONG%3EManaged%20Property%20AssignedTo%20contains%3A%26nbsp%3B%5BME%5D%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EMicrosoft%20describes%20behavior%20here%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.content.office.net%2Fde-de%2Fmedia%2F15b638d5-fc1c-434d-8e5e-aa1809b819f7.jpg%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.content.office.net%2Fde-de%2Fmedia%2F15b638d5-fc1c-434d-8e5e-aa1809b819f7.jpg%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EHas%20anyone%20an%20idea%20how%20to%20get%20around%20this%3F%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-260132%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHighlighted%20Content%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EManaged%20Properties%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EModern%20Experience%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-333731%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20Experience%3A%20Highlighted%20Content%20-%20filter%20for%20two%20%22and%22%20connected%20managed%20proper%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-333731%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3Emy%20workaround%20for%20that%20issue%20was%3A%3C%2FP%3E%3CP%3Ecreate%20SiteCollection%20calculated%20column%26nbsp%3B%20that%20will%20hold%20all%20your%20AND%20statement%20(my%20issue%20was%20to%20see%20Task%20Status%20%2B%20User%20for%20example%20all%20tasks%20for%20Dave%20and%20are%20not%20completed)%3C%2FP%3E%3CP%3Eafter%20creating%20the%20column%20add%20it%20to%20ContectType%3C%2FP%3E%3CP%3Eadd%20the%20content%20type%20to%20the%20taks%20list%2C%20reindex%20the%20list%3C%2FP%3E%3CP%3Ego%20to%20search%20schema%20and%20add%20your%20own%20Managed%20Property%20that%20looks%20to%20the%20new%20column%20you%20created%3C%2FP%3E%3CP%3Enow%20you%20can%20filter%20the%20data%20you%20need%20with%20an%20AND%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20you%20cant%20find%20the%20column%20in%20the%20Management%20Property%20you%20will%20have%20to%20wait%20until%20the%20next%20Full%20crawl%20to%20happend%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20that%20helped%20you%3C%2FP%3E%3CP%3EDave%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-261767%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20Experience%3A%20Highlighted%20Content%20-%20filter%20for%20two%20%22and%22%20connected%20managed%20proper%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-261767%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Frank%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Esadly%20I%20cannot%20set%20any%20%22AND%22%20or%20%22OR%22%20in%20this%20filter.%20The%20%22AND%22%20or%20%22OR%22%20is%20set%20by%20SharePoint%20Online%20itself.%3C%2FP%3E%3CP%3EIf%20three%20different%20filters%20are%20used%20they%20will%20be%20connected%20with%20%22AND%22.%20If%20one%20filter%20is%20used%20several%20times%20is%20values%20are%20connected%20with%20%22OR%22%20and%20this%20filter%20is%20connected%20with%20%22AND%22%20to%20other%20filters.%20See%20picture%20below.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fsupport.content.office.net%2Fde-de%2Fmedia%2F15b638d5-fc1c-434d-8e5e-aa1809b819f7.jpg%22%20border%3D%220%22%20%2F%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EProblem%20is%20that%20if%20you%20choose%20%22Managed%20property%22%20filter%20twice.%20One%20for%20the%20property%20%22AssignedTo%22%20and%20once%20for%20the%20property%20%22PercentageComplete%22%20both%20filters%20will%20be%20automatically%20set%20to%20be%20%22OR%22%20connected%20as%20it%20is%20the%20same%20filter%20(in%20SharePoint's%20eyes).%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-260677%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20Experience%3A%20Highlighted%20Content%20-%20filter%20for%20two%20%22and%22%20connected%20managed%20proper%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-260677%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20OR%20statements%20invalidates%20all%20previous%20filters%20in%20the%20view.%20Try%20the%20following%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EManaged%20Property%20PercentageComplete%20contains%3A%20100%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3B%20AND%3C%2FP%3E%3CP%3E%3CEM%3ETitle%20contains%3A%20project%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3ECreated%20by%26nbsp%3Bis%3A%20John%20Doe%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%26nbsp%3B%3CSTRONG%3EOR%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3EManaged%20Property%20AssignedTo%20contains%3A%26nbsp%3B%5BME%5D%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20AND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3ETitle%20contains%3A%20project%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3ECreated%20by%26nbsp%3Bis%3A%20John%20Doe%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BAND%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CEM%3EEdit%3A%20Just%20as%20a%20note%2C%20I%20think%26nbsp%3B%5BME%5D%20evaluates%20to%20a%20user%20object%20or%20user%20id%20so%20if%20your%20AssignedTo%20field%20is%20a%20managed%20metadata%20column%20I%20don%C2%B4t%20think%20you%20will%20get%20any%20results%20as%20they%20will%20never%20be%20equal.%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1642071%22%20slang%3D%22en-US%22%3ERe%3A%20Modern%20Experience%3A%20Highlighted%20Content%20-%20filter%20for%20two%20%22and%22%20connected%20managed%20proper%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1642071%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F281148%22%20target%3D%22_blank%22%3E%40David_Vidal%3C%2FA%3E%26nbsp%3BHi%20Dave%2C%20Thank%20you%20for%20your%20post%20I%20am%20having%20the%20exact%20same%20issue%20as%20you!%20I%20came%20across%20your%20discussion%20here%20but%20don't%20really%20understand%20your%20workaround%20can%20you%20explain%20it%20in%20a%20little%20more%20detail.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EI%20have%202%20custom%20columns...%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EBusinessFunction%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CEM%3E%26nbsp%3B(With%20the%20following%20values)%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B-%20Marketing%3C%2FP%3E%3CP%3E-%20Sales%3C%2FP%3E%3CP%3E-Technical%3C%2FP%3E%3CP%3E%3CSTRONG%3EBusinessRole%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CEM%3E(With%20the%20following%20Values)%3C%2FEM%3E%3C%2FP%3E%3CP%3E-%20Director%3C%2FP%3E%3CP%3E-%20Dept%20Manager%3C%2FP%3E%3CP%3E-%20Sales%20Rep%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20issue%20is%20a%20Technical%20function%20has%20a%20Director%20as%20does%20a%20Marketing%20Function.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20if%20I%20have%20a%20list%20as%20follows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESales%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Director%3C%2FP%3E%3CP%3ETechnical%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BDirector%3C%2FP%3E%3CP%3EMarketing%26nbsp%3B%20%26nbsp%3BDirector%3C%2FP%3E%3CP%3ESales%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BSales%20Rep%3C%2FP%3E%3CP%3ESales%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BDept%20Manager%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can't%20return%20Sales%20Director%3F%3F%3F%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Modern Experience sites provide the "Highlighted Content" web part for dynamically filtering content. 

Filtering works like this:

 

Title contains: project

     AND

Created by is: John Doe

     AND

Managed Property PercentageComplete contains: 100

 

If you select different filters, they are connected by "AND".

But: If you select a filter twice it gets connected with "OR". That makes sense in this example:

 

Title contains: project     OR     Title contains: order

     AND

Created by is: John Doe

     AND

Managed Property PercentageComplete contains: 100

 

But if you need to filter on two Managed Properties you struggle with this limitations:

 

Title contains: project

     AND

Created by is: John Doe

     AND

Managed Property PercentageComplete contains: 100    OR     Managed Property AssignedTo contains: [ME]

 

Microsoft describes behavior here: 

https://support.content.office.net/de-de/media/15b638d5-fc1c-434d-8e5e-aa1809b819f7.jpg

 

Has anyone an idea how to get around this? 

4 Replies

Hi,

 

The OR statements invalidates all previous filters in the view. Try the following:

 

Managed Property PercentageComplete contains: 100 

    AND

Title contains: project

     AND

Created by is: John Doe

  OR

Managed Property AssignedTo contains: [ME]

    AND

Title contains: project

     AND

Created by is: John Doe

     AND

 

Edit: Just as a note, I think [ME] evaluates to a user object or user id so if your AssignedTo field is a managed metadata column I don´t think you will get any results as they will never be equal.

Hi Frank,

 

sadly I cannot set any "AND" or "OR" in this filter. The "AND" or "OR" is set by SharePoint Online itself.

If three different filters are used they will be connected with "AND". If one filter is used several times is values are connected with "OR" and this filter is connected with "AND" to other filters. See picture below.

 

 

Problem is that if you choose "Managed property" filter twice. One for the property "AssignedTo" and once for the property "PercentageComplete" both filters will be automatically set to be "OR" connected as it is the same filter (in SharePoint's eyes). 

 

Hello,

my workaround for that issue was:

create SiteCollection calculated column  that will hold all your AND statement (my issue was to see Task Status + User for example all tasks for Dave and are not completed)

after creating the column add it to ContectType

add the content type to the taks list, reindex the list

go to search schema and add your own Managed Property that looks to the new column you created

now you can filter the data you need with an AND

 

if you cant find the column in the Management Property you will have to wait until the next Full crawl to happend

 

Hope that helped you

Dave

@David_Vidal Hi Dave, Thank you for your post I am having the exact same issue as you! I came across your discussion here but don't really understand your workaround can you explain it in a little more detail. 

I have 2 custom columns...

BusinessFunction

 (With the following values)

 - Marketing

- Sales

-Technical

BusinessRole

(With the following Values)

- Director

- Dept Manager

- Sales Rep

 

My issue is a Technical function has a Director as does a Marketing Function.

 

So if I have a list as follows:

 

Sales            Director

Technical     Director

Marketing   Director

Sales           Sales Rep

Sales           Dept Manager

 

I can't return Sales Director????