Official Site
Microsoft Most Valuable Professional M365 Apps & Services
Microsoft Most Valuable Professional Business Applications
Consultant & Sr Cloud Solution Architect Modern Wokrplace
Find hereMore than 150 Articles about Microsoft Technologies on Modern Workplace
24 April 2024
In today's article, we will see how we can transfer files from a SharePoint folder to another folder in a Library using Power Automate.
First, you need to have an active M365 subscription and select Power Automate from the available applications. In the next step, you need to select templates from the left menu and find the "Move files from one SharePoint folder to another" template.
Next, select "Continue" to allow all necessary connections.
As you can see, we have an automation with three actions.
The trigger action is "when a file is created," and here you need to provide the site address where your library is hosted and the library name. Finally, select the folder where every time a new file is created, it will create a copy of it in another library and delete the specific file. The reason for this action is to categorize files into more than one library after their initial upload to the system.
Imagine a scenario with external partners who you want to have access to only one of your libraries. They will upload their files there, and then you will route the files to the desired libraries using your automations without giving access to those external partners to these libraries.
In the next action, "create file," you need to specify the site hosting the library of the file and the target destination folder where your file will be stored. You also need to name the new file by selecting the existing name from the properties and the file content. Note that you need to specify the file type in the name, e.g., .docx, otherwise, the system will transfer a file that it cannot open, not knowing what type it is.
The last action is "delete file," where you need to provide the site hosting the library where this file was created and the file identifier so that it can be deleted.
In the next step, we will save our automate
and run a manual test.
We return to our library and create a new file.
We return to the automate and see that it executed successfully.
Then we go to the new folder and see that the file has been transferred there.
As I mentioned earlier, you need to pay attention to the name and type of the file being transferred, e.g., .docx, otherwise, the system will transfer a file that it cannot open, not knowing what type it is, as you can see happening in the image above.
and then you can see the file now with the content
Visit Archives below to find more articles about Microsoft technologies on Modern Workplace