I am using the .NET Client Object Model from a website to access data in a SharePoint list. One of the fields I am trying to access is a lookup field. How do I get the text for the lookup field using a join in the CAML query?

I have read so far that joins are not supported in CAML in the Client Object Model. Is this true?

The issue is doctype comes back with a message saying it is a lookup field.

It is not possible for me to use the SharePoint Server Object Model.

Here is a snippet of what I am doing:

ClientContext _clientContext = new ClientContext(ConfigurationManager.AppSettings["SPServer_DigAssts"].ToString());

List list = _clientContext.Web.Lists.GetByTitle("Leases");
CamlQuery camlQuery = new CamlQuery();

camlQuery.ViewXml = "@<View><Query><Where><Eq><FieldRef Name='BuildingId'/><Value Type='Text'>" + bid.ToString() + "</Value></Eq></Where></Query></View>";

ListItemCollection listItems = list.GetItems(camlQuery);

_clientContext.Load(listItems, items => items.Include(item => item["BuildingId"], item => item["DocType"], item => item.DisplayName));


foreach (ListItem listItem in listItems) 
    DataRow r = dtbl.NewRow();
    r["BuildingId"] = listItem["BuildingId"];
    r["Name"] = listItem.DisplayName;
    r["DocType"] = listItem["DocType"];
  • What is the error you are receiving? Sep 4, 2013 at 23:59

1 Answer 1


Use following code to read the lookupvalue

var docType= listItem["DocType"] as Microsoft.SharePoint.Client.FieldLookupValue;
string value = docType.LookupValue;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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