When we retrieving list items with field "Person or Group" via
client object model
The values that return from column "Person or Group" is
"[Object Object]".
To retrieve
specific field is we use the code below:
listItem.get_item ('Field name');//My field name is "User name" so I use like this
var UserName=listItem.get_item('User_x0020_Name');var itemsResult="<tr><td>"+UserName+"</td>"+"<td>"+Questionsright+"</td>"+"<td>"+Timetaken+"</td></tr>";
$(itemsResult).appendTo("#mytable");
Result:
Function to be append is:
var UserName=listItem.get_item('User_x0020_Name').get_lookupValue();If field is multiple selections:
var UserName=listItem.get_item('User_x0020_Name')[0].get_lookupValue();
And it's will retrieve the user name
No comments:
Post a Comment