
Announcements
Hello everyone,
I’m running into an issue when using Get files (properties only) in Power Automate to retrieve a specific SharePoint folder by its name.
The folder name contains an apostrophe (').
Example pattern: Something l'emploi
I’m using this OData filter:
ContentType eq 'Folder' and FileLeafRef eq 'Something l'emploi'
This fails with: The file or folder cannot be found.
I tried escaping the apostrophe (as required by OData) like this:
ContentType eq 'Folder' and FileLeafRef eq 'Something l''emploi'
But the query still does not match the folder, even though the folder does exist.
Other tests:
Removing the filter works (it returns all folders)
Filtering on names with no apostrophes works
The issue happens only when an apostrophe is in the folder name
Using substringof() also fails when the value contains '
Is there a correct or supported way to filter FileLeafRef values that contain an apostrophe using the SharePoint connector OData $filter?
Or is this a known limitation of the SharePoint connector?
I would appreciate any insight or examples.
Thanks!
FSObjType eq 1 and FileLeafRef eq 'Something l''emploi'

replace(variables('varFolderName'),'''','''''')
'''' = one apostrophe (')
'''''' = two apostrophes ('')