Am trying to get the Person or Group field(approver) value using REST API in SharePoint2010. am able to get the account details but i need the display name of the Approver. here is the my code
$.ajax
({ url: siteURL+ "/_vti_bin/ListData.svc/"+ listName +"("+ietmID+")?$select=Name,Approver/Account&$expand=Approver",// list item ID
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data)
{
var listiteminfo= data.d;
var approvers="";
var approverLenght=listiteminfo.Approver.results;
//alert(approverLenght.length);
for (var j = 0; j < approverLenght.length; j++) {
alert(approverLenght[j].Account);
}
//success(data.d);
},
error: function (data)
{
alert('error');
// failure(data.responseJSON.error);
}
});