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

Currently, I am using an ajax request to access the list items. The fields that are not lookups come as expected but the lookup fields come across as an ID of the object that corresponds to its original list. How can I get the title of the lookup? I have been looking at a lot of post but I cannot figure out how to adapt the things I have found to my code.

My code posted below is just the request and the saving of the data. My ajax code looks like:


        url: siteUrl + "/_api/lists/getbytitle('" + listName + "')/items", 
        type: "GET",
        headers: {
            "accept": "application/json;odata=verbose",
        success: function (data) {
            jQuery.each(data.d.results, function (index, item) {
                listItem =  item;
                  //creates the new object
                var taskHolder = new Task(
share|improve this question
up vote 4 down vote accepted

You need to use the $expand option in your query string.

siteUrl + "/_api/lists/getbytitle('" + listName + "')/items?$select=NameOfLookup/FieldYouWant&$expand=NameOfLookup/NameOfFieldYouWant"

So yours would be:

"/_api/lists/getbytitle('" + listName + "')/items?$select=$expand=status_x0028_test_x0029/Title&$expand=status_x0028_test_x0029/Title

This will bring back all of the associated data. Here I have a list called Test List and a lookup field called Status. The 2013 REST API does not support bulk loading the data like the ListData.svc REST service did/does.

Bulk expansion and selection of related items is not supported. --MSDN

So you have to specify the field you want in both the select and expand. Here is example output from my list in O365.

enter image description here

    "d": {
        "results": [
                "__metadata": {
                    "id": "26f2b95d-ae86-44b7-bc69-dda79c88d742",
                    "uri": "'efd16a43-aaf4-44fd-a9a1-4634afe328ac')/Items(2)",
                    "etag": "\"1\"",
                    "type": "SP.Data.Test_x0020_ListListItem"
                "Status": {
                    "__metadata": {
                        "id": "86127a54-7c19-49c6-8e48-e4f56919433e",
                        "type": "SP.Data.StatusesListItem"
                    "Title": "Development"
                "Title": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dol",
                "StatusId": 3

Notice the JSON contain the Status field shown in the image witht he value of the Title field in the source list which is "Development"

"Status": {
    "__metadata": {
        "id": "86127a54-7c19-49c6-8e48-e4f56919433e",
        "type": "SP.Data.StatusesListItem"
    "Title": "Development"
share|improve this answer
So, should I use the name of the look up as SP has it "status_x0028_test_x0029_Id"(this only holds the ID of the item from the other list) or as it is printed on the list page? It is printed as "status(test)". Currently, I have tried both but I keep getting a "value": "The field or property 'status_x0028_test_x0029' does not exist." or "value": "The expression \"status(test)\" is not valid." – user24005 Feb 27 '14 at 15:36
Thought it might be useful to see my actual queries: siteUrl + "/_api/lists/getbytitle('" + listName + "')/items?$expand=status(test) and siteUrl + "/_api/lists/getbytitle('" + listName + "')/items?$expand=status_x0028_test_x0029 – user24005 Feb 27 '14 at 15:41
I'm sorry, I was confusing the 2010 REST with 2013. I have corrected/updated my answer with more detail – Robert Kaucher Feb 27 '14 at 19:01
Thanks finally got it. It seems that the $select portion is required to use the $expand query. Thanks again. – user24005 Feb 28 '14 at 5:36

What is the solution to the get the value of lookup field

var table = $('#example').DataTable({ "filter": true, "bDestroy": true, "bProcessing": true, "aaData": data.d.results, "aoColumns": [ { "mData": "ID" }, { "mData": "Title" },{ "mData": "lookupfield" },]

share|improve this answer
I am afraid this is not answer, if you query author of a question/answer, the you must first attain 50 reputations and get eligible for commenting everywhere. Or else ask your own question. – Asad Refai Aug 24 '15 at 11:09

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.