If conditions not working using REST
If conditions not working using REST
beginner_2018
Posts: 46Questions: 19Answers: 0
Dear All,
I had written the using REST API to retrieve SharePoint list items .
And I had written the if condition to return the blank value to the Order column.
Can any one do let me know what's wrong in my below code.
Also, This is to inform you in prior that as I am working on SharePoint list items there is no source to display Live Data table
$('#table_id').DataTable({
"aaData": data.d.results,
"aoColumns": [{
"mData": "Title"
},
{
"mData": "Order"
render: function(data, type, row, meta) {
if(data == "error;#256") {
return " "
} else {
return data
}
}
}
]
});
This discussion has been closed.
Answers
Hi @beginner_2018 ,
You have to give us a bit more help here! Why isn't working? What is it doing that's wrong? It's you're return value where
"error;#256"
is sent is wrong, what does a console debug show it's value as?Cheers,
Colin