SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to retrieve a list of items including lookup fields via listdata.svc. My lookup points to a list of companies which has the following fields: Title, Address, Phone.

By default, listdata doesn't return the lookup data, only a link to it. If I use the $expand parameter, then listdata returns all the fields of the lookup.

How can I make listdata return the lookup Title only, not the other fields like Address and Phone?

share|improve this question
up vote 11 down vote accepted

This page has some good examples on using listdata.svc and specific examples on drilling down into specific items to be selected.

Using the REST Interface

Examples from page

Using code:

var query = (DataServiceQuery<InventoryLocationsItem>)context.
       .Where(p => p.Part.SKU.StartsWith(SearchSku)).OrderBy(p => p.Part.SKU);

Manually constructing the URL:

share|improve this answer
thx, I'll try this. The [list]/[column] notation seems to be what I'm looking for. – Christophe Dec 29 '11 at 1:02
Worked great! Do you happen to know how to get rid of the _metadata? – Christophe Dec 29 '11 at 1:29
Unfortunately, no, I do not know how to get rid of the _metadata. – Alban Dec 29 '11 at 15:27
It shows 'An error occurred while processing this request' if the lookup value is null. Please Help – Shreyas Nov 5 '15 at 6:57

Assuming that the Title is the "foreign key" don't you already have that value in the primary list? Alternatively, don't you get the values if you add the other columns to the Lookup column to pull them across with the key?

share|improve this answer
No you don't (contrary to what Web services will do for example). You don't get the lookup id either. Let's say that REST services are very "performance concious" ;-) – Christophe Dec 29 '11 at 0:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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