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
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):
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
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.
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.
FOUND IT!
&filter=fields/id eq 1
&filter=fields/ContentType eq 'Apartment Page'
-> NO DOUBLE QUOTES
&filter=startswith(fields/id,1)
@mhbuur
add request header Prefer: HonorNonIndexedQueriesWarningMayFailRandomly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With