Question

I am trying to query a list where the Title starts with a letter in the range from a to m and I can't find that anywhere in the sparse documentation available.

I tried this but it isn't valid and I am pretty sure that I would end up over the character limit allowed in a URL anyway.

/humanresources/_api/web/lists/GetByTitle('Corporate Directory')/items?$filter=( startswith(Title, 'a') Or startswith(Title, 'b')  )&?orderby=Title asc

Any help is appreciated.

Thanks in advance!

Was it helpful?

Solution

Try this:

$filter=title ge 'a' and title lt 'n'

OTHER TIPS

In your example there is a typo in Filter expression:

$filter=( startswith(Title, 'a') Or startswith(Title, 'b')  )

The name of logical operator is or (lowercase letters in name!) , please refer Supported OData Query Options for a more details.

Below is provided a valid query:

/humanresources/_api/web/lists/getbytitle('Corporate Directory')/items?$filter=startswith(Title, 'a') or startswith(Title, 'b')&?orderby=Title asc
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top