I am using SharePoint 2013 REST. I have list which contains many look up columns, I can get list items through list if they are not look up columns but I can't select and also filter based on look up columns.
for example my list have 4 columns 2 are look up column:
Title, Company, Province
Where province is a look up field how can I select filter my data based on province field ?
which is a look up field it gives error.
My REST Code:
$.ajax({
url: "https://Myserver.com/sites/ibs/omt/_api/web/lists/getByTitle('Test')/items?$select=Title,Province/ID&$expand=Province/ID&$filter=Province eq'"+province +"'",
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
},
success: function(data){
$.each(data.d.results, function(index, item){
//$('#first_data').html(item.Title);
$('.int_extras').append("<a style='font-weight:bold; color:#FFFFFF;margin:2px;' href='"+links+item.ID+"'>"+item.Title+"</a><br />");
});
},
error: function(error){
alert(JSON.stringify(error));
}
)};
I am new to REST queries please give your examples in details