In Sharepoint 2010 I am getting display name of the user with SPServices like 11;#John, Kondo
. But I want account name like mydomain\aa2311
. Is there any way to get the account name with the display name property?
Not for the currently logged in user. I am having one person or group column in sharepoint list. I am getting values from this column. It is giving like 11;#John Kondo
Following is the code :
var getListItemsFrom= function(listName, viewFields, queryText, rowCount, queryOptions, asyncBool){
var deferred = $.Deferred();
$().SPServices({
operation:"GetListItems",
async: asyncBool,
listName:listName,
CAMLRowLimit:100,
CAMLQuery:queryText,
CAMLViewFields:viewFields,
completefunc:function(data){
deferred.resolve(data);
}
});
return deferred;
};
getListItemsFrom("Demand Requests",viewFields ,query,0,"",true).then(function(data){
$(data.responseXML).SPFilterNode("z:row").each(function(ind,elm){
var requestorAccountIds = $(this).attr('ows_Requestor');//ows_Requestor is person or group field
});
});