/* in the same way I need to get values from look up column which consisting of multiple columns from another list into a variable */ url : _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Cities')/items?$select=Country/Title&$expand=Country/Title",

1

There are 1 answers

0
Thangu On

Hope you got the results in data.d.results.

var results=data.d.results;
displayObjectProperty("getData",results,"Title");
function displayObjectProperty(id,object,Property){
                for(var x in object)
                {
                              if(typeof(object[x]) == "object"){displayObjectProperty(id,object[x],Property)}else{
                              if(x==Property){
                                              document.getElementById(id).innerHTML += "<b>" + x + "</b>"+"::<i>" + object[x] + "</i>";
                }
                }
                }

        }