I run a query with REST over two lists. List1 is connected through the field Country with List2.

In the console, I can read the data from the second List but I can't seem to extract it from data.d.results.

success: function (data) {
    var items = data.d.results;
    for(var i = 0; i < items.length;i++) {
    message += items[i].Date_x0020_of_x0020_Event + items[i].Column2 + ' <br />';                             

Column2 is the field in List2 connected with Country from List1. It's not retrieving anything there.

console after query

1 Answer 1


To extract data.d.results you can use for loop as the following:

for (var i = 0; i < data.d.results.length; i++) 
     var item = data.d.results[i];  

For more details Check


Consider, you have two lists:

  • List1.
    • Col1.
  • List2.
    • ColA.
    • LookupField to List1.Col1

So to query List 2 use the below endpoint


To read it use

  • Thanks for the comment, The Title is easy to get, it's the column2 in the second List. I think I can retrieve with this: html += "<tr><td>" + item.Title + "</td><td>" + item.EmployeeName + "</td><td>" + item.Salary + "</td><td>" + item.Dept.Title + "</td><td>" + item.Dept.Code + "</td></tr>"; I guess I have to call item.Listname.Field
    – Marco
    Commented Nov 6, 2017 at 18:54
  • You should use item.LookupField.Col1 , Please Check the updated answer Commented Nov 6, 2017 at 19:21
  • Hi Mohammed, yes I checked your link and I saw it's item.Lookupfield.col1 Cheerz
    – Marco
    Commented Nov 6, 2017 at 19:58
  • @Marco Please don't forget to Mark the answer as accepted in case it helped you :) Thanks! Commented Nov 6, 2017 at 19:59

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.