Hello. I am trying to send char & in filter
web.lists.getByTitle("XXXXX").items.filter("field1 eq 'test' and field2 eq 'te&st'").select("Title").get().then((itemsHR: any[]) => {
The problem that I get error
Uncaught (in promise) Error: Error making HttpClient request in queryable [400] ::> {"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The expression \"field1 eq 'test' and field2 eq 'te\" is not valid.
Thank you very much for your help.
Hi @enti333,
Such special characters should be escaped. It's arguably should it be on the library's or custom app side. It's even more likely should not be in the library, as it is now. I'd recommend wrapping values through encodeURIComponent when you know that special symbols might be there.
Thank you Andrew. I was thinking if there is no better solution for this. But this is good enough. So Again Thank you very much.
Most helpful comment
Hi @enti333,
Such special characters should be escaped. It's arguably should it be on the library's or custom app side. It's even more likely should not be in the library, as it is now. I'd recommend wrapping values through
encodeURIComponentwhen you know that special symbols might be there.