I'm trying to move file on SharePoint from one site collection to another using Power Automate, but they can have special characters in their name or path.
I wanted to use GetFileByServerRelativePath and MoveToUsingPath, that manage # and %.
The first part GetFileByServerRelativePath is working well, I can find the document, but when I add MoveToUsingPath I get an error : "An unexpected 'PrimitiveValue' node was found when reading from the JSON reader. A 'StartObject' node was expected"
Here is the request (I removed Power Automate parameters for URLs, I use encodeUriComponent function):
_api/web/GetFileByServerRelativePath(DecodedURL=SourceURL)/MoveToUsingPath(newpath=EncodedDestinationURL,moveOperations=1)
For now I'm trying on the same site collection, when it's working on the same site, I'll try on 2 sites.
Source = /sites/ArchiveSandBox/Source Library/test #1/Book%2.xlsx
Destination = /sites/ArchiveSandBox/Destination/test #1/Book%2.xlsx
Can you help me with this?
Thanks
Note: I tried MoveTo, CopyTo, and I have the error : "Folder "test #1" does not exist."