i try the code but it's seems outdated
function GetAllStatuts(){
var myURL = "../_api/web/lists/GetByTitle('Demandes%20EDI')/Items?$top=5000&$select=Statut";
var AllStatuts = [];
$.ajax({
url: myURL,
async: false,
method: "GET",
headers: { "accept": "application/json;odata=verbose" },
success: function (data) {
if (data.d.results.length > 0) {
alert("success satut");
AllStatuts = data.d.results;
for (var i = 0; i < Number(AllStatuts.length); i++){
alert("in loop");
AllUniqueStatus.push(AllStatuts[i].Statut);
}
AllUniqueStatus = removeDuplicates(AllUniqueStatus);
alert(AllUniqueStatus.join("-"));
}
},
error: function (error) {
alert("Error: " + JSON.stringify(error));
}
});
return AllUniqueStatus;
}
i have this errorError: {"readyState":4,"responseText":"{\"error\":{\"code\":\"-2147024891, System.UnauthorizedAccessException\",\"message\":{\"lang\":\"fr-FR\",\"value\":\"Attempted to perform an unauthorized operation.\"}}}","responseJSON":{"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"fr-FR","value":"Attempted to perform an unauthorized operation."}}},"status":403,"statusText":"Forbidden"}
it's seems the chart.js doesn't run with sharepoint online ?!?