cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Odata filter to access the content type values

Here's the json for the file in the library...
"Title": "Travel Contacts",

loads of stuff...
"{ContentType}": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
"Id": "0x0101009D1CB255DA76424F860D91F20E6C411800C08426C6F9FC57419D50439873D9610A",
"Name": "Site Page"
}

 

I want to filter where the files using the GetFiles Properties action item filters for specifically "Site Page" I tried this and got the following error...

 

sasrsc_0-1595973846689.png

 


ContentType/Name eq 'Site Page'

The error message is:

The query is not valid.
clientRequestId: 8253b38f-15ff-4765-bfd9-0e6e783c5812
serviceRequestId: 8253b38f-15ff-4765-bfd9-0e6e783c5812

 

Thanks and sorry to be so dumb about this.

can you also help me ask this question properly by telling you what this "Content Type" object is...

It's not an array..Name is an variable within the Content Type object. So how do you really state that? (I'm not a programmer)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Odata filter to access the content type values

Not to say this is the best way but it does work...I experimented with using the filter array and this seems to work. So in the initial pull of files from the SP Doc Library I do this...I found this suggestion and I thought it was clean and simple...

1) Set a variable to 30 days in the past

2) Grab only the older files not touched in the last 30 days (in this example) using the odata filter.

 

sasrsc_0-1596024699998.png

the expression is ...

sasrsc_1-1596024798118.png

3) Lastly I do the filter array which now has "easy" access to the contenttype\name value using the normal dynamic content selector.

sasrsc_2-1596024825843.png

Sharing in case this helps others

View solution in original post

2 REPLIES 2
Highlighted
Super User II
Super User II

Re: Odata filter to access the content type values

HI @sasrsc 

 

Your query looks good, but for everything other than strings and numbers, the connector struggles to do proper filtering.

 

You can try using SharePoint's API to get the information, but it makes things a little bit more complex. Here's an article in how to do it:

https://blog.velingeorgiev.com/powerautomate-and-sharepoint-odata-filter-queries

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Highlighted
Helper I
Helper I

Re: Odata filter to access the content type values

Not to say this is the best way but it does work...I experimented with using the filter array and this seems to work. So in the initial pull of files from the SP Doc Library I do this...I found this suggestion and I thought it was clean and simple...

1) Set a variable to 30 days in the past

2) Grab only the older files not touched in the last 30 days (in this example) using the odata filter.

 

sasrsc_0-1596024699998.png

the expression is ...

sasrsc_1-1596024798118.png

3) Lastly I do the filter array which now has "easy" access to the contenttype\name value using the normal dynamic content selector.

sasrsc_2-1596024825843.png

Sharing in case this helps others

View solution in original post

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (5,440)