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 / Error using "Copy file...
Power Automate
Unanswered

Error using "Copy files between Box and SharePoint" template

(0) ShareShare
ReportReport
Posted on by 5

When using the "Copy files between Box and SharePoint" template, I get an error that I suspect results from the Box "File Path" value including the file name, so that SharePoint doesn't like it as the value for "Folder".

 

Here's the config:

 

MSFlowProb1.png

 

The resulting error is below. Note that the "Folder Path" includes the file name. I think that's the problem, but I'm not certain. Any help is appreciated. Thanks!

 

Reason

  • Code
    BadRequest

 

Inputs

  • Site URL
    <sharepoint.com URL>
  • Folder Path
    /T4S_Dev/Rick's Test file 2 - Copy.txt
  • File name
    Rick's Test file 2 - Copy.txt
  • File Content
    dfadfadf

 

Outputs

  • Headers
    { "Pragma": "no-cache", "x-ms-request-id": "<removed>", "Cache-Control": "no-cache", "Date": "Mon, 09 Jan 2017 22:48:57 GMT", "Set-Cookie": "ARRAffinity=<removed>;Path=/;Domain=127.0.0.1", "Server": "Microsoft-IIS/8.0,Microsoft-HTTPAPI/2.0", "X-AspNet-Version": "4.0.30319", "X-Powered-By": "ASP.NET", "Content-Length": "346", "Content-Type": "application/json; charset=utf-8", "Expires": "-1" }
  • Body
    { "status": 400, "message": "The expression \"web/folders/add('/T4S_Dev/T4S_Dev/Rick's Test file 2 - Copy.txt')\" is not valid.", "source": "https: //<site>.sharepoint.com/<share  doc location>/_api/web/folders/add('/T4S_Dev/T4S_Dev/Rick's%20Test%20file%202%20-%20Copy.txt')", "errors": [ "-1", "Microsoft.SharePoint.Client.InvalidClientQueryException" ] }
Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    on at

    Hi @T4S-Rick,

     

    Agreed. The error here should be related with the file path.

    The folder path auto-generated from box can't be used as reference under SharePoint file path.

    Please click the Folder icon at the right side of the Folder path input box, which would Navigate you to the proper folder path under SharePoint Library, choose the proper folder path there would correct the error you encountered.

    20.PNG

    If you have any further questions, please feel free to post back.

    Regards

  • T4S-Rick Profile Picture
    5 on at

    Thanks for the quick response!

     

    Unfortunately, by just specifying a single target folder in SharePoint, I lose the file's original path in box.

     

    For example, if the file from Box is in folder \Dir1\Dir2\Dir3\FileName, the method you specify would lose the original path. All the files, regardless of their source path, would all end up in the same SharePoint folder.

     

    What I'm trying to do is copy new files in Box to SharePoint and maintain the same relative paths in SharePoint. In the above example, the folder path in SharePoint would also be \Dir1\Dir2\Dir3\FileName (under, let's say, \Shared Documents).

     

    My impression is that there's no current way to do that.

     

    Thanks again.

  • v-micsh-msft Profile Picture
    on at

    Hi @T4S-Rick,

     

    Yes, if you would like to keep the file path information, then currently I don't think this could be done.

    Please consider to submit this as an idea in the flow idea forum.

    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

    Regards

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard