Sharepoint - How to get lookup value only via REST (listdata.svc)

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.
    CreateQuery<InventoryLocationsItem>("InventoryLocations")
       .Expand("Part")
       .AddQueryOption("$select", 
                       "BinNumber,Quantity,Title,Id,PartId,Part/SKU,Part/Title")
       .Where(p => p.Part.SKU.StartsWith(SearchSku)).OrderBy(p => p.Part.SKU);

Manually constructing the URL:

http://contoso/sites/sharepointlist/_vti_bin/listdata.svc/InventoryLocations()
  ?$filter=startswith(Part/SKU,'sku')
    &$orderby=Part/SKU
      &$expand=Part
        &$select=BinNumber,Quantity,Title,Id,PartId,Part/SKU,Part/Title

Tags:

Rest