Showing results for 
Search instead for 
Did you mean: 
Not applicable

Microsoft Flow / Sharepoint - Copy to folder based on list ID?



I currently have a list called HR forms. 

List Columns are
File Name , Employee ID

Ideally, I wanted the file to be renamed to {Employee ID}.{File Name} and then moved to the corresponding restricted access folder. Unfortunately renaming is not possible but luckily I can create a copy and delete the one uploaded. However, I'm struggling to figure out how I would have the file copied to the correct folder. 

Community Support
Community Support

Re: Microsoft Flow / Sharepoint - Copy to folder based on list ID?

Hi @ Dozers,


Could you please explain more about your requirement?


Do you want to save the file to corresponding restricted access folder in your sharepoint library when a file is created in a folder in your sharepoint library?


Do you want to rename the file to {Employee ID}.{File Name}? Does the value in the "Employee ID" column,and "File Name" column is in a special item? 

Could you please share an example of the new file's name?


Such as if an item in the list with ID "1",and the "Employee ID" of the item is "123", the "File Name" of the item is "test.xlsx", when a file is created in library1,the flow would copy the file to library2,and the file would be renamed to {123}.{test}..xlsx ?


If you would like to achieve something such as my example,please refer to steps below to achieve your needs:

I have created a sharepoint list as below:



The list only have one item which's ID is "1", and I would create a flow to create a file and the file's name is {123}.{test}.xlsx .


The screenshot of the flow as below:




 The expression in the "file expression" as below:


The expression in the "filename without expression" as below:




The expression in the "new file name" as below:



The flow would run successfully to create the new file in the library2 when a file is created in library1 as below:



However,even though the file is created in the library2, the filename in the library2 would be "_123_._test_.xlsx" as screenshot below:



Maybe the filename in the flow would convert the "{" and "}" to "_" automatically.


Please let me know if your issue could be solved.




Alice Zhang

Not applicable

Re: Microsoft Flow / Sharepoint - Copy to folder based on list ID?

I tried to replicate your solution but am unable to bring up the purple connector { } that lets me manually enter in the expressions.

Helpful resources

Did you attend MBAS? Claim your badge

Attending MBAS? Claim your badge

Whether you’ve streamed the digital event live, or you're watching on-demand, claim your attendee badge to sport on your profile.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.


New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!


Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

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


Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Users online (6,001)