Search This Blog

Saturday, July 8, 2017

Get LookUp and Author Name Using REST API + SharePoint 2013

How to get Author/Title or Name from AuthorID = dataResults.Title

function getUser(id, tdHtml){


   var returnValue;
     jQuery.ajax({
      url: "https://YourSite/_api/Web/GetUserById(" + id + ")",
      type: "GET",
      headers: { "Accept": "application/json;odata=verbose" },
      success: function(data) {
             var dataResults = data.d;
          alert(dataResults.Title);
       
      }
    });
  }

How to get Author/Title or Name from AuthorID in one single Rest call / query


/_api/web/lists/getbytitle('KhaitanDocLib')/items?$select=Author/Title,PracticeArea/Title&$expand=Author/Id,PracticeArea

No comments:

Post a Comment