Hi @Mohammad Qasim ,
& characters are not encoded by default in URL. We need to specify the encoded values for those special characters in rest api. And for a single apostrophe ( ' ), we need to replace a single apostrophe with two to make it work.
You could use the below function to achive this:
function fixedEncodeURIComponent(src) {
return encodeURIComponent(src).replace(/[']/g, function (c) {
return '%' + c.charCodeAt(0).toString(16) + '%' + c.charCodeAt(0).toString(16);
});
}
Then construct the url like this:
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('TestList')/items?$filter=Nomenclature eq '" +fixedEncodeURIComponent(nomenclature[0])+"'",
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.