Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

microsoft graph API using filter on get sharepoint items

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

like image 938
bresleveloper Avatar asked Dec 01 '17 12:12

bresleveloper


People also ask

How to apply filter by lookup value in graph API?

It seems Graph API does not support to apply filter by lookup value As a workaround you could consider the following solution to filter by lookup value (requires two requests). 1)first step would be to query Departments list by Title and return Id property (which corresponds to DepartmentLookupId property in Employee list):

How to integrate SharePoint site lists with azure graph API?

In your tenant Azure portal, navigate to Azure active directory “App Registration”. Open your app to provide the permission for accessing the SharePoint site lists & libraries via Microsoft Graph API. Once you navigate to the registered application -> Click API Permissions

How to get access token using Microsoft Graph API for SharePoint?

Follow the below article to learn how to fetch an access token using Microsoft Graph API: In your tenant Azure portal, navigate to Azure active directory “App Registration”. Open your app to provide the permission for accessing the SharePoint site lists & libraries via Microsoft Graph API.

Is it possible to filter the values returned by graph endpoint?

It seems like filtering on the values that are returned by the graph endpoint (such as lastModifiedDateTime, createdDateTime, etc.) is not supported, since requests like /items&$filter=lastModifiedDateTime ge '2018-01-01' will return a "Invalid filter clause" error. Show activity on this post.


2 Answers

FOUND IT!

&filter=fields/id eq 1

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

&filter=startswith(fields/id,1)

like image 71
bresleveloper Avatar answered Oct 12 '22 17:10

bresleveloper


@mhbuur

add request header Prefer: HonorNonIndexedQueriesWarningMayFailRandomly

like image 37
Mani Avatar answered Oct 12 '22 16:10

Mani