web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Using the "_api/site/C...
Power Automate
Suggested Answer

Using the "_api/site/CreateCopyJobs" endpoint to move files to their related folder

(2) ShareShare
ReportReport
Posted on by 1,950 Season of Giving Solutions 2025
I wanted to move a Folder from one SharePoint site to another. So i used the MoveTo option provided inside the list views:-
 
 
the process started for around 1 hour then stop progressing, so i cancelled the process .. now on the destination i got all the Folders and sub-folders and around 3500 files. but some files are missing. so i wrote this workflow to move the remaining files to their related folders inside the destination. Where the source files were inside a library named "Marketing", inside the root Folder named "Marketing", then a sub-folder named "Archive",,, while on the destination we have the files inside a library named "Archive", then a root folder named "Archive":-
 
1) First, i got all the files ONLY inside the source:-
 
 
 
2) then i used this end point "_api/site/CreateCopyJobs" to do the move:-
 
 
 
 
where inside the Compose i am converting the source path to the destination path:-
 
if(
  greater(length(last(split(items('Apply_to_each')?['{Path}'], 'Marketing/Marketing/Archive/'))), 0),
  concat(
    '/Archive/Archive/',
    if(
      equals(
        substring(
          last(split(items('Apply_to_each')?['{Path}'], 'Marketing/Marketing/Archive/')),
          sub(length(last(split(items('Apply_to_each')?['{Path}'], 'Marketing/Marketing/Archive/'))), 1),
          1
        ),
        '/'
      ),
      substring(
        last(split(items('Apply_to_each')?['{Path}'], 'Marketing/Marketing/Archive/')),
        0,
        sub(length(last(split(items('Apply_to_each')?['{Path}'], 'Marketing/Marketing/Archive/'))), 1)
      ),
      last(split(items('Apply_to_each')?['{Path}'], 'Marketing/Marketing/Archive/'))
    )
  ),
  ''
)
 
 
I test this on a test tenant, and the operation moved the files to their related destination folders ,, but since i want to apply this to the Prod site which failed, so generally speaking, is my approach valid?
Thanks
 
Hint, i used the above endpoint to do the move, and not the built-in Move File action, since the built-in "Move File" action will raise this error:-
 
Missing or mismatched field definition on the destination list for source field '_dlc_DocId' type 'Text'. Source site template id '7', target site template id 'SitePagePublishing'. Total blocked root objects in this operation is [1]
Categories:
I have the same question (0)
  • Suggested answer
    w.p Profile Picture
    8,345 Super User 2026 Season 1 on at

    Reading the error message, it seems the target document library doesn't have the _dlc_DocId column, so you may need to manually add this column.

    I'm not sure if Power Automate can handle moving a lot of files at once, as it could lead to to throttling issue. Even manual moving out-of-the-box has a limit.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard