Forum Discussion

johnjohn-Peter's avatar
johnjohn-Peter
Iron Contributor
Aug 14, 2024

The Expression is not valid, if the uri contain single quote inside the Uri field

I have a "Send an http request to SharePoint", where i am passing a file name, as follow:-

 

 

 

now incase the file name contain a single quote such as :-

 

d'Emploi-Organization Grant.docx

 

i will get this error:-

 

 

{
  "status": 400,
  "message": "{\"odata.error\":{\"code\":\"-1, Microsoft.SharePoint.Client.InvalidClientQueryException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The expression \\\"LeafName eq 'd'Emploi-Organization Grant.docx'\\\" is not valid.\"}}}\r\nclientRequestId: 55063edc-b342-4deb-98fe-88daf96c5dd3\r\nserviceRequestId: b9cc45a1-d019-6000-4a0f-328de72410d4",
  "source": "*****/_api/web/RecycleBin?$filter=LeafName%20eq%20'd'Emploi%20-Organization%20Grant.docx'&$select=Id",
  "errors": []
}

 

 

now i try to surround the file name with `encodeUriComponent` but did not fix the issue..

any advice?

Thanks

 

No RepliesBe the first to reply

Resources