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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Problem moving file fr...
Power Automate
Unanswered

Problem moving file from one sharepoint site to another

(0) ShareShare
ReportReport
Posted on by 28

Hi,

since mid of last week some of my flows do not work properly any more. We have time triggered flows that check if a new file is stored on a SharePoint site folder and then distributes them to other site folders plus sends out an email. That still works if the site folder is on the same site as original one, but not if it should move the file to another site. I could rewrite the flow to generate a new file and delete the one on the original location, but then need to check if the file already exists. This was much easier with the move file action. Does anyone see the same behavior or does anyone have a clue what might have changed last week ?

Here is the output of the error and a screenshot of the flow error:

Not sure why the site ID mismatch appears. If I create a flow to create a file instead of moving it, it does have the ability to access it.

 

{"statusCode":400,"headers":{"Vary":"Origin","X-SharePointHealthScore":"2","X-MS-SPConnector":"1","X-SP-SERVERSTATE":"ReadOnly=0","DATASERVICEVERSION":"3.0","SPClientServiceRequestDuration":"63","SPRequestGuid":"f0663b77-2fd0-4d66-bfd6-2219197b7fad","request-id":"f0663b77-2fd0-4d66-bfd6-2219197b7fad","MS-CV":"dztm8NAvZk2/1iIZGXt/rQ.0","Strict-Transport-Security":"max-age=31536000","X-FRAME-OPTIONS":"SAMEORIGIN","Content-Security-Policy":"frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.powerapps.com *.yammer.com *.officeapps.live.com *.office.com *.stream.azure-test.net *.microsoftstream.com;","MicrosoftSharePointTeamServices":"16.0.0.21423","X-Content-Type-Options":"nosniff","X-MS-InvokeApp":"1; RequireReadOnly","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"true","Cache-Control":"max-age=0, private","Date":"Mon, 05 Jul 2021 14:45:11 GMT","P3P":"CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"","X-AspNet-Version":"4.0.30319","X-Powered-By":"ASP.NET","Content-Length":"935","Content-Type":"application/json","Expires":"Sun, 20 Jun 2021 14:45:12 GMT","Last-Modified":"Mon, 05 Jul 2021 14:45:12 GMT"},"body":{"status":400,"message":"System.ArgumentException: SiteId mismatch\r\n at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl, Boolean includeQueryString, Boolean canonicalizeUrl, Boolean doNotChangeEncoding)\r\n at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(SPResourcePath url, Boolean includeQueryString, Boolean canonicalizeUrl)\r\n at Microsoft.SharePoint.SPFile.MoveCopyInternal(SPResourcePath newUrl, MoveUrlFlags grf, Boolean requireWebFilePermission, String etagMatch, Guid originatorId, String& newETag, Boolean allowNoExecuteWebFileUpdate)\r\n at Microsoft.SharePoint.SPFile.MoveTo(SPResourcePath newPath, SPMoveOperations moveOperations)\r\n at Microsoft.SharePoint.Administration.SPMigrationOrchestrator.PerformCopyWithinWeb(SPCopyMigrationParameters migParams)\r\nclientRequestId: f0663b77-2fd0-4d66-bfd6-2219197b7fad\r\nserviceRequestId: f0663b77-2fd0-4d66-bfd6-2219197b7fad"}}



Flow error.jpg

Categories:
I have the same question (0)
  • mobashee Profile Picture
    on at

    Dear partner,

    Is this issue intermediate?

    Can you please reach out to support, this needs to be reported to SharePoint / PA team.

     

    Did I answer your question? Please consider to mark my post as a solution to help others.

     

    Regards,

    Mohamed Sanuj Basheer

  • Bobat42 Profile Picture
    28 on at

    The issue is not intermediate. Seems that this happens since 31.6. 
    I opened a ticket on the service status of the admin console, but the reply was that there was no problem found.

  • Ramiz Profile Picture
    245 on at

    Hi @Bobat42 ,

    Please check that the account that you are using in flow has enough permission to other site. Can you access the other site with the account that you are using to build a flow?

  • Bobat42 Profile Picture
    28 on at

    Hello Ramiz,

     

    the account used has admin rights. I can access the other site and can create a new file there using a flow.

  • Ramiz Profile Picture
    245 on at

    Hi @Bobat42 ,

    By looking at your attached image of flow, I think you have setup If another file is already there then fail the action. Please check that whether the same file is already present in the destination site or not.  Try changing it to Replace and test. Also check the destination site URL as well.
    I have tested it on my end and flow is moving the file from one site to another.

  • Bobat42 Profile Picture
    28 on at

    Hello Ramiz,

    thank you for the hint, but that did not solve the issue. However I got a step further. I recreated a test flow without any conditions as shown in the image here:

    testflow.jpg

    It actually moved the subfolders in the library plus the according files in those, but not the files I needed in the root of the library. I tried versions with subfolders yes and no and file identifier or name with extension. So if you could help with the correct entries here or send a screenshot of your flow it would be appreciated.

    Strangely the flows worked for several months as they were and then suddenly stopped working last week. 

     

  • Ramiz Profile Picture
    245 on at

    Hi @Bobat42 ,

    I didn't get the issue. Can you elaborate?
    Are you moving folders or files? For files there is an action Move File and for folders there is a separate action Move Folder. Which one are you using?

  • Bobat42 Profile Picture
    28 on at

    Hello Rmaiz,

     

    I want to move files and use the Move File action. (Datei verschieben in german) . The folder where the files initially appear looks like this:

    Bobat42_0-1625574291005.png

    After execution of my test flow as depicted above, all files (the word file Dies ist ein Test.docx and the pdf Dies ist ein Test.pdf) remain in the sharepoint library/folder, but all the subfolders and the files in those are moved to the other sharepoint site.

     

  • Bobat42 Profile Picture
    28 on at

    Sorry, I forgot. That is exactly the opposite of what I am trying to achieve.

  • Ramiz Profile Picture
    245 on at

    Dear @Bobat42 


    Try this.

    Ramiz_0-1625575422036.png

     

     

    Ramiz_2-1625575548079.png

    Ramiz_3-1625575643953.png

     

    I used filter array to filter only files. There is a property called IsFolder that I am using. Filter array will filter all the files in Scan Upload folder and the include nested items property is set to No so the files inside the subfolders of Scan Upload folder wont count.
    Hope this helps and works.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard