Hi Team,
I am retrieving the list data to a grid using Jquery datatable, if multiple selection choice field is selected in list for Peoplepicker column, data not coming in UserName field. Can someone correct this
Below is the JS code I am retriving the data
$(document).ready(function () {
loadData();
});
function loadData() {
try {
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('testlist')/items?$select=Department,SiteURL,RequiredHours,Status,UserName/Title&$expand=UserName/Id",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (result) {
data = result.d.results;
console.log(data);
try {
$('#table_id').DataTable({
"aaData": data,
"aoColumns": [
{
"mData": "Department"
},
{
"mData": "SiteURL"
},
{
"mData": "RequiredHours"
},
{
"mData": "Status"
},
{
"mData": "UserName.Title"
}
]
});
} catch (e) {
alert(e.message);
}
},
error: function (error) {
console.log(JSON.stringify(error));
}
});
} catch (e) {
console.log(e);
}
}
I am getting the below error:
DataTables warning: table id=table_id - Requested unknown parameter 'UserName.Title' for row 0, column 4. For more information about this error, please see http://datatables.net/tn/4
Ganesh