Share via

Power Automate HTTP Move File – Encoded Characters Changing File Name

Anonymous
2025-05-23T10:44:34+00:00

Good day,

I’m trying to move a document to another library within the same SharePoint site using Power Automate. I’m not using the standard “Move file” action in Power Automate because it causes issues when the columns of the two libraries don’t match. Instead, I’m using the following HTTP request to SharePoint:

POST

_api/web/lists(guid'listID')/items(itemID)/File/moveto(newurl='/sites/siteName/TLF/document%.docx',flags=1)

This request successfully moves the file, but the document name gets changed to document%25.docx.

I’ve already tried encoding the file name and the entire URL using the encodeUriComponent function, but that doesn’t work either.

For example, I’ve also tried this:

_api/web/lists(guid'listID')/items(itemID)/File/moveto(newurl='/sites/siteName/TLF/encodeUriComponent('document%.docx')',flags=1)

Is there a way to make this work? I don’t want to modify the file’s metadata after moving it. Thanks in advance for any responses.

Microsoft 365 and Office | SharePoint | Other | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2025-05-23T20:14:31+00:00

    Hi Rahim,

    Thank you for reaching out to Microsoft Community Support. It looks like the issue is caused by URL encoding, where the % character in the file name is being converted to %25. Based on Microsoft Learn and community discussions, here are some possible solutions:1. Use Correct Encoding for the File NameInstead of manually encoding the file name, try using double encoding:plaintext_api/web/lists(guid'listID')/items(itemID)/File/moveto(newurl='/sites/siteName/TLF/document%2525.docx',flags=1)This ensures that % is correctly interpreted as part of the file name.2. Use Power Automate’s "CreateCopyJobs" APISome users have reported success using the CreateCopyJobs API instead of moveto. This method avoids encoding issues:json{ "destinationUri": "/sites/siteName/TLF/document%.docx", "options": { "KeepBoth": false } }You can find more details on this approach here.3. Try SharePoint REST API AlternativeAnother workaround is using the MoveCopyUtil.MoveFileByPath endpoint:_api/SP.MoveCopyUtil.MoveFileByPath(overwrite=@a1)?@a1=trueThis method ensures the file name remains unchanged during the move process.4. Check for Microsoft UpdatesMicrosoft may have updated Power Automate’s handling of file moves.Contact Microsoft Support – If you need more information and update, you may need to reach out to Microsoft Support through

    • Ticket Support: Visit Microsoft Support and sign in to submit a support request.
    • Phone Support: Microsoft provides customer service phone numbers based on your region. You can find the appropriate contact number here.

    I hope this information will help you well. Please let us know if you require any further assistance.Best Regards,Hoang-D - MSFT | Microsoft Community Support Specialist

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful