If you’re using a document Name field in a workflow but it’s not working as expected, it could be because there are apostrophes (‘) or ampersands (&) in document names. In this case, SharePoint evaluates apostrophes (‘) to ' and ampersands (&) to & As you can see here, most other punctuation evaluates perfectly well:
Note: This problem only occurs when using apostrophes and ampersands in document names, in document libraries. And we can fix the issue without needing to rename the files.
Document names cannot contain these punctuation marks: \ / . : * # “
Regular lists and document library fields aside from the Name field shouldn’t experience this issue. But if you’re using & or ‘ in your file names, and calling those file names in workflow, here’s how we can make it work: