Rest API Call - Multiple SharePoint List

function GetListItems() {
    function getJsonDataAsync(url) {      
        return $.ajax({
            url: url,
            method: "GET",
            contentType: "application/json",
            headers: {
                accept: "application/json;odata=verbose"
            }
        });
    }

    var ListData1 = _spPageContextInfo.webServerRelativeUrl + "/_api/lists/GetByTitle('listname1')"
    var ListData2 = _spPageContextInfo.webServerRelativeUrl + "/_api/lists/GetByTitle('listname2')"
   
    var response1= getJsonDataAsync(ListData1);
    var response2= getJsonDataAsync(ListData2);
 
   
    jQuery.when(response1, response2).done(function(resp1, resp2) {
        //do ur code here
    });
}

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell