How do i set up Power automate to copy and move a file to different folders

Copper Contributor

Hi 

I am trying to find a way to set up Power Automate to copy a file from folder (e.g. Original folder) to e.g. Transit folder and also move the same file from Original folder to Processed folder. I have currently set up as follows:

trial flow.PNG

Ignore the last step - sending email thats just for testing purposes. In the above I am only worried that if the Copy file flow doesnt work but the Move file flow works then it will affect our work since the file would have disappeared from the original folder.

The reason I am doing it as above it to retain the version history- unless there is a better way to do the above and the file in the Processed folder has the correct version history.

Thanks for any help rendered

Geeta

 

3 Replies

@all

I tried the setup and found that the copy step had failed. 

trial flow2.PNG

The Error details came up as follows:

Microsoft.SharePoint.SPException: Cannot open "C22-0021 Downer - Dunedin Asp SMA10 FPB 1 782.xlsx": no such file or folder. ---> System.Runtime.InteropServices.COMException: Cannot open "C22-0021 Downer - Dunedin Asp SMA10 FPB 1 782.xlsx": no such file or folder. at Microsoft.SharePoint.Library.SPRequestInternalClass.MoveUrl(String bstrUrl, StorePath bstrWebRelOldUrl, StorePath bstrWebRelNewUrl, MoveUrlFlags moveFlags, String etagMatch, Guid& pgOriginatorId, String& pbNewETag, Boolean fAllowNoExecuteWebFileUpdate, Int64& plldestListFlags, Int32 iSearchFlags) at Microsoft.SharePoint.Library.SPRequest.MoveUrl(String bstrUrl, StorePath bstrWebRelOldUrl, StorePath bstrWebRelNewUrl, MoveUrlFlags moveFlags, String etagMatch, Guid& pgOriginatorId, String& pbNewETag, Boolean fAllowNoExecuteWebFileUpdate, Int64& plldestListFlags, Int32 iSearchFlags)
--- End of inner exception stack trace ---
at Microsoft.SharePoint.SPFile.MoveCopyInternal(SPResourcePath newUrl, MoveUrlFlags grf, Boolean requireWebFilePermission, String etagMatch, Guid originatorId, String& newETag, Boolean allowNoExecuteWebFileUpdate, Int32 searchFlags) 

at Microsoft.SharePoint.SPFile.CopyTo(SPResourcePath newPath, SPCopyOperations copyOperations)
at Microsoft.SharePoint.Administration.SPMigrationOrchestrator.PerformCopyWithinWeb(SPCopyMigrationParameters migParams)
clientRequestId: 4bc99e8f-a4a2-4017-9bda-bf09ebce15d9
serviceRequestId: 4bc99e8f-a4a2-4017-9bda-bf09ebce15d9

------------

Does the text in bold mean that the file was already moved before it could be copied?

Any help would be appreciated

Regards

Geeta

Yes, it appears that the move has happened before the copy. Can't you simply move the Move step below the Copy step?
Hi jefmeyer
Tried that. It didn't work. Will try a few other options.