Solved

O365 Search Query by Content Type

  • 19 February 2017
  • 7 replies
  • 4 views

Badge +2

Hi all,

 

I'm trying to use the Office 365 Search Query action to return only documents of a certain content type.  I've tried setting the "Result source" to "Items matching a content type", but couldn't figure out from that point where I provide the specific content type ID. 

 

Any help would be much appreciated.

 

Thanks,

-Haniel

icon

Best answer by rhia 28 March 2018, 08:34

View original

7 replies

Userlevel 6
Badge +15

Hi there - 

So I haven't used this before, but, based on what I see here:

http://help.nintex.com/en-US/o365/#o365/O365WorkFlow/WorkflowActions-INT/Office365SearchQuery.htm?Highlight=search query

As well as poking around in my O365 environment, it seems like you can put the Content Type into the Exact Match. However...

Further down, there is a field for Property Restrictions, where you can add several types of filters. 

I think this might help you on your way! Let me know. 

Cheers!

Rhia

Badge +2

Hi Rhia,

Is Current Item a variable you defined?  I don't have that option available.

Thanks,

-Haniel

Badge +2

I forgot to mention that I'm running this as a site workflow, not list-based workflow.

Regards

Userlevel 6
Badge +15

Ah I see - that is probably different! I will take a look.

Userlevel 6
Badge +15

Okay, so I looked a bit more, and I am not 100% sure on where this would be done in the action only... but...

I think you could create a custom result source with

{searchTerms} ContentType:"Minutes"

as the query, and point to that. 

You're right, in that I don't see the ability to point to list level properties (such as Content Type ... which makes sense) at the Property Restriction level. 

Hopefully someone else will pop in and let us know..!

Badge +8

Hi Haniel Croitoru‌,

What you need to do is use the managed property: ContentTypeId. Every content type has an unique ID (Check this MSDN article). Get this ID and do something like:

The * means that also all child content types should be included.

Cheers,

Rick

search query‌

Userlevel 6
Badge +15

So a year has passed, and, I'm a year wiser. I'm also ready to answer this question for real since I just spent way too much time playing with it to figure it out.

Rick Bakker‌ was very close - but at least, for me, the asterisk did not act as a wild card unfortunately. 

I went to our Site Settings, and Content Types, to get the ID from the URL (after clicking on the content type itself). It turns out, though, that every list appends it's own mish-mash after that ID to make it unique. I think that is basically what Rick is saying but it flew over my head. 

Anywho, here is how I got it to work:

I used the Content Type ID from the Site Settings, as all the rest of the lists / libraries that use that Content Type START with the same - but don't end the same way. So the "Begins With" works like a charm. 

Cheers!

Rhia

PS: Past Rhia was dumb. Why did she even post an answer? She had no clue what she was talking about.

Reply