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 / Sharepoint copy file -...
Power Automate
Unanswered

Sharepoint copy file - how to specify destination location with data created by previous step

(0) ShareShare
ReportReport
Posted on by 15

Hi, sorry if this question has been answered a thousand times already.......... I am new and can't specify the search properly to get the right answer

 

I want my flow to create a new sharepoint site and then want to copy a file from a reference sharepoint site to my new site. I am able to create the site using an HTTP POST with /_api/SPSiteManager/create. I then parse the Output to recover the newly created SiteURL. I then use this recovered value as my destination location and use a string value of /Shared Documents/ as the destination folder.

 

This generates a 400 message as follows

 

"Failed to verify the existence of destination location at 'https://XXXXXXXXXXXXX.sharepoint.com/sites/NEWSITE/Shared Documents/' due to error 'The system cannot find the file specified. (Exception from HRESULT: 0x80070002)'.\r\nclientRequestId: 6df2058e-02c6-46b2-be21-ea15e1b2264e\r\nserviceRequestId: 6df2058e-02c6-46b2-be21-ea15e1b2264e"

 

Is it that the list of sites is not being refreshed, or am I missing something?

 

Thanks in advance

 

Categories:
I have the same question (0)
  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    This error would seem to occur if the destination folder does not exist or in your case, perhaps the Site creation process had not yet completed?

    You could add a delay before the file copy action. Experimenting with count and units:

    ekarim2020_2-1632946713117.png

    Ellis

     

    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

     

     

     

  • momobazz Profile Picture
    15 on at

    Hi Ellis,

     

    Thanks for responding. I tried this set at 30 minutes and I am still experiencing the same time out problem. It almost appears as if the HTTP Post isn't completing properly.

     

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Can you confirm that the site is actually created by browsing to the site URL:

    ekarim2020_0-1633003521283.png

    I used the following code to create a site:

    ekarim2020_1-1633003621367.png

     

    {
     "request": {
     "Title": "Demo Site",
     "Lcid": 1033,
     "ShareByEmailEnabled": false,
     "Url": "https://tenancyName.sharepoint.com/sites/mdrnsite",
     "Classification": "",
     "Description": "",
     "WebTemplate": "SITEPAGEPUBLISHING#0",
     "WebTemplateExtensionId": "00000000-0000-0000-0000-000000000000",
     "HubSiteId": "00000000-0000-0000-0000-000000000000",
     "Owner": null
     }
    }

     See: https://docs.microsoft.com/en-us/sharepoint/dev/apis/site-creation-rest

    Ellis

  • momobazz Profile Picture
    15 on at

    Hi Ellis,

     

    Sorry for taking so long to reply........... I was unwell for a few days....... I have tried several different approaches. The most simplistic approach I have taken is to create a new site using the SitePoint Admin screens (i.e no Flow involved whatsoever). I then waited an hour........ and then tried to create a brand new flow that simply copied a file from one site to the new site. Not only was the new site not available in the list of available sites, but when I tried to force it using variables to hold the name of the new website and shared documents as the destination it still failed

     

    momobazz_0-1633423601612.png

     

    I received the following message as an error

     

    Failed to verify the existence of destination location at 'https://XXXXXX.sharepoint.com/sites/CN/Shared Documents/' due to error 'The system cannot find the file specified. (Exception from HRESULT: 0x80070002)'.
    clientRequestId: 4c13b960-bbdb-4f59-b477-04a2f0fa79e1
    serviceRequestId: 4c13b960-bbdb-4f59-b477-04a2f0fa79e1

     

    Any clues?

     

    And thanks for your patience

     

     

  • Ellis Karim Profile Picture
    11,681 Super User 2025 Season 2 on at

    Can you share the Copy File action?

    Ellis

  • Verified answer
    momobazz Profile Picture
    15 on at

    Hi Ellis,

     

    I finally found the culprit......... Everything now woks as it should.......... All I had to do is clear the browser (Firefox) cache........

     

    Thanks very much for your help and patience

     

    Best

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard