0
votes

I can get all items in a list with: https://graph.microsoft.com/v1.0/sites/{SiteID}/lists/{ListID}/items

I can get a specific item in a list with: https://graph.microsoft.com/v1.0/sites/{SiteID}/lists/{ListID}/items/{ItemID}

But I have to KNOW the ItemID to interact with that specific item.

Is there no way to use $search or $filter on list items to find an item by one of my actual column values, like $filter=Title eq 'whatever', to then be able to pull the ItemID for that item so I can update values for it?

Or do I just have to download the entire list and filter it myself? Seems inefficient though if it were to be a large list.

Thank you!

1
AFAIK, the columns that are created for lists are not indexed, so they are not searchable or filterable. You can simply get the items with fields(Columns) using this http call https://graph.microsoft.com/v1.0/sites/{siteid}/lists/{listid}/items?$expand=fields and then filter it on your end by writing code.Shiva Keshav Varma

1 Answers

0
votes

The filtering can be allowed by adding the header Prefer: HonorNonIndexedQueriesWarningMayFailRandomly.

GET https://graph.microsoft.com/v1.0/sites/{siteId}/lists/{listId}/items?$expand=fields&filter=fields/Title eq 'whatever'

One disadvantage is that such queries can fail on large lists