12

i am trying to filter my Sharepoint Items results query with the Microsoft Graph API as explained here so i am trying this https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items so i tried adding

?&filter=od eq 1, or copying from expand ?filter=fields(select%3Did) = 1, none works. please help

mhbuur
  • 175
  • 1
  • 13
bresleveloper
  • 5,940
  • 3
  • 33
  • 47
  • There is a feature request open here, please vote: https://feedbackportal.microsoft.com/feedback/idea/aa3cdd9a-b9f3-ec11-a81b-000d3a00c008 – mhbuur Jun 24 '22 at 12:33

3 Answers3

15

FOUND IT!

&filter=fields/id eq 1

&filter=fields/ContentType eq 'Apartment Page' -> NO DOUBLE QUOTES

&filter=startswith(fields/id,1)

bresleveloper
  • 5,940
  • 3
  • 33
  • 47
3

@mhbuur

add request header Prefer: HonorNonIndexedQueriesWarningMayFailRandomly

Mani
  • 65
  • 5
  • Thanks. This is not really a production ready solution though as it "MayFailRandomly" and it will certainly fail with large lists. – mhbuur Jun 27 '22 at 08:50
1

You don't need to filter by id just do:

https://graph.microsoft.com/beta/sites/{site-id}/lists/{list-id}/items/{id}
Baris Bikmaz
  • 401
  • 3
  • 11