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

Iron 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????