Forum Discussion
Mike Jansen
Mar 21, 2017Iron Contributor
Rest api search query --- Lookup field issue
I have a document library which has a custom field "Label" this Label field is a lookup field (to a list) multiple values allowed. For example my documentlibrary: Title Label doc1 ...
- Mar 22, 2017Haven't tested it, but it should work with the $filter:
/_api/web/lists/GetByTitle('Documents')/items?$select=*,Label/Title&$expand=Label&$filter=Label/Title eq 'labelX'
Let us know how it goes.
Mike Jansen
Mar 22, 2017Iron Contributor
Hi Luis Mañez, and Brent Ellis,
Thank you both!! Found the solution.
Now make it some more dynamic but I can manage that.
For your information, this is my query:
https://blabla.sharepoint.com/sites/mike/label/_api/web/lists/getByTitle('Documents')/items?$select=*,Label/Title&$expand=Label&$filter=Label/Title eq 'labelX'&rowlimit=500
Jun 26, 2017
Just to give a great article related to this question:
http://www.andrewconnell.com/blog/Applying-Filters-to-Lookup-Fields-with-the-SP2013-REST-API