function getEmpList()
{
$.ajax({
url: siteurl + "/_api/web/lists/getbytitle('TestEmpInfo')/items?$select=Id,EmpName",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
empList.push(data.d.results);
console.log(empList);
var uniqueEmpList = GetUnique(empList);
console.log(uniqueEmpList);
for(i=0;i<data.d.results.length;i++)
{
$('#totalEmpList').append($("<option/>").val(uniqueEmpList[i].Id).text(uniqueEmpList[i].EmpName));
}
},
error: function (data) {
alert("Error: "+ data);
}
});
}
Please help me with this
I have to get uniques values of shrepoint list to a dropdown
Thanks in advance