When i retrieve data from a person and group column this is what i get as a string below
{"__metadata":{"id":"3d427c6e-2322-4121-b106-f248277eab3f","type":"SP.Data.UserInfoItem"},"LastName":"XXX"}
How can i retrieve XXX ad not the whole metadata string
Currently i'm doing the below
var myAngApp = angular.module('SharePointAngApp', []);
myAngApp.controller('spCustomerController', function ($scope, $http) {
$http({
method: 'GET',
//url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Test')/items?$select=Title",
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Test')/items?$select=Title,Notify/LastName&$expand=Notify/id",
headers: { "Accept": "application/json;odata=verbose" }
}).success(function (data, status, headers, config) {
$scope.customers = data.d.results;
}).error(function (data, status, headers, config) {
});
});
nometadata
instead ofverbose
, but you will still get a JSON object, not just XXXX