Introduction
In this article, we will see how can we copy file with a new name from one document library to another document library using MS Flow.
Follow the below steps to copy the file with the new name.
Copy file with a new name from one document library to another using MS Flow
Step 1
Add an action for Initialize Variable. Now create a variable for the new file name and give a value.
It will be the new file name that you want after copying the file. This will be a file name with an extension.
Step 2
Now, add an action for Get file content.
- In Site Address field, select the site from which site’s document library you want to copy file.
- In File Identifier field, select the file which you want to copy using the folder icon of this field.
Step 3
Now, add an action for Create file.
- In Site Address field, select the site where you want to copy the file.
- In Folder Path field, select the path of the folder where you want to copy the file by clicking on the folder icon. (In the above screenshot, I have used a dynamic path.)
- In File Name field, select the variable which we have created in the first step.
- In File Content field, add the below expression:
Step 4
Now once this flow will trigger, it will copy a file with the new name.
Conclusion
This is how we can copy file with a new name using MS Flow. Hope you will find this article helpful!