cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
scm8nwr
Level: Powered On

Flow to move a selected document in SharePoint

Can anyone share a working flow to move a selected document in SharePoint from one folder to another in the same library? And if possible, across document libraries and sites, or even site collections?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flow to move a selected document in SharePoint

Hi @ scm8nwr,

 

What is the “site collection” that you mentioned and want to move a selected document from sharepoint library to?

You could refer to link below to learn more about running a flow for a selected file:

https://flow.microsoft.com/en-us/blog/flow-in-spo-document-libraries/

 

I would offer you a workaround to create a flow and move a selected document from one folder of sharepoint library to another in the same library or another sharepoint library, please refer to steps below:

  1. Sign in to your sharepoint, select the library which contain your file that you want to create a flow.
  2. Tick the file, then click the Flow and select the “Create a flow”from list.

1.png

     3. Create an flow with template “Request manager approval for a selected item”

 2.png

     4. Create connection between flow and connector, click Continue to edit your flow, the screenshot of the flow as below:

 3.png

     5. Add an action “Get file metadata” under the “Get item” action, choose the site address in the “Site Address” field, choose the “Identifier” dynamic content of “Get item” action in the “File Identifier” field.

     6. Add an action “Get file content” under the “Get file metadata” action, choose the site address in the “Site Address” field, choose the “Identifier” dynamic content of “Get item” action in the “File Identifier” field.

     7. Add an action “create file” under the “Get file content” action, choose the site address in the “Site Address” field, choose the destination file address in the “Folder Path” field.(You could choose another folder in the same library as the selected file and also another sharepoint library), choose the “Name” dynamic content of “Get file metadata” action in the “File Name” field. choose the “File Content” dynamic content of “Get file content” action in the “File Content” field.

     8. Add an action “Delete file” under the “create file” action, choose the site address in the “Site Address” field, choose the “Identifier” dynamic content of “Get item” action in the “File Identifier” field.

     9. You could rename the flow to “move a selected document” and save the flow.

 

Image reference:

 4.png

Go to your sharepoint library, select the file that you want to move to another path, click the “Flow” and you could see the flow you have created an the file, you could click the flow “move a selected document” and click “Run flow” as screenshot below:

 5.png6.png

The flow would run successfully as below:

 7.png

 


Regards,
Alice Zhang

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Flow to move a selected document in SharePoint

Hi @scm8nwr,

 

Why would you want to do that? There's already a copy/move functionality available in SharePoint for that. 

Did you try that?

 

- Daniel

scm8nwr
Level: Powered On

Re: Flow to move a selected document in SharePoint

Hi Daniel,

 

Fair point, I didn't mention that I wanted to add an approval around this hence using Flow, although my core question was around moving a selected document

Super User
Super User

Re: Flow to move a selected document in SharePoint

You can probably do that with the http action. You can register an app and use the SharePoint Rest API to move a document. There is no out of the box action available for this. There is an action available for copying a document. Maybe that could help you? 

 

Check the following link for more info: https://docs.microsoft.com/en-us/connectors/sharepointonline/#Copy_file

Community Support Team
Community Support Team

Re: Flow to move a selected document in SharePoint

Hi @ scm8nwr,

 

What is the “site collection” that you mentioned and want to move a selected document from sharepoint library to?

You could refer to link below to learn more about running a flow for a selected file:

https://flow.microsoft.com/en-us/blog/flow-in-spo-document-libraries/

 

I would offer you a workaround to create a flow and move a selected document from one folder of sharepoint library to another in the same library or another sharepoint library, please refer to steps below:

  1. Sign in to your sharepoint, select the library which contain your file that you want to create a flow.
  2. Tick the file, then click the Flow and select the “Create a flow”from list.

1.png

     3. Create an flow with template “Request manager approval for a selected item”

 2.png

     4. Create connection between flow and connector, click Continue to edit your flow, the screenshot of the flow as below:

 3.png

     5. Add an action “Get file metadata” under the “Get item” action, choose the site address in the “Site Address” field, choose the “Identifier” dynamic content of “Get item” action in the “File Identifier” field.

     6. Add an action “Get file content” under the “Get file metadata” action, choose the site address in the “Site Address” field, choose the “Identifier” dynamic content of “Get item” action in the “File Identifier” field.

     7. Add an action “create file” under the “Get file content” action, choose the site address in the “Site Address” field, choose the destination file address in the “Folder Path” field.(You could choose another folder in the same library as the selected file and also another sharepoint library), choose the “Name” dynamic content of “Get file metadata” action in the “File Name” field. choose the “File Content” dynamic content of “Get file content” action in the “File Content” field.

     8. Add an action “Delete file” under the “create file” action, choose the site address in the “Site Address” field, choose the “Identifier” dynamic content of “Get item” action in the “File Identifier” field.

     9. You could rename the flow to “move a selected document” and save the flow.

 

Image reference:

 4.png

Go to your sharepoint library, select the file that you want to move to another path, click the “Flow” and you could see the flow you have created an the file, you could click the flow “move a selected document” and click “Run flow” as screenshot below:

 5.png6.png

The flow would run successfully as below:

 7.png

 


Regards,
Alice Zhang

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 258 members 3,369 guests
Please welcome our newest community members: