3

Assuming there is a list of Students with their zip-codes in one of the columns, what is the query string needed to get only students with a certain zip-code?

So far here is what I've got:

site.com/_api/web/Lists/getByTitle('Student')/?$what-goes-here=value

8

You need to use $filter

/_api/web/Lists/getByTitle('Student')/items?$filter='Internal Name of the column' eq "Some value"

Let me know the internal name of your column and value also so that I can write the exact query for you.

See more about $filter in my CodeProject Article.

PS: Ignore '' from 'Internal Name of the column'

CRUD Operation to List Using SharePoint 2013 Rest API

  • If someone else reads this: this didn't work for me until I removed the single quotes from the column internal name – K48 Nov 15 '16 at 12:24
  • Good catch. Answer updated. – Atish Dipongkor - MVP Nov 15 '16 at 12:45
0

Yes without the ' ' from the 'Internal Name of the column' it worked for me. For the filter value I used in addition ' ':

/_api/web/Lists/getByTitle('Student')/items?$filter=InternalNameOfTheColumn eq 'SomeValue'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.