cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
eisbaum
Regular Visitor

Copy files in folders with the specific name including folder structure between SharePoint libraries - Error encountered

Hello PowerAutomate community, 

 

I am trying to build a new SP library based on an existing SP library. I need to copy files and subfolders in the specific folders (i.e., folder name that contains "deliverables"). I referred to a blog, which was helpful for copying files from the specific folders, but I soon realised that it does not keep the folder structure. I encountered an error after adding the condition to the flows.

I am sharing the flows I created following the blog post (with references provided below). You can see the error message as well.

 

In my case, the condition with the file path length does not apply. I need to copy all the files and subfolders in the folders whose name contains "deliverable" maintaining the folder structure. If I could get help on my specific case, that'd be excellent.  

Looking forward to any advice. 

 

eisbaum_0-1634537385952.png

The blog posts I referred to: 

https://tomriha.com/copy-files-between-sharepoint-libraries-power-automate/ 

https://tomriha.com/how-to-get-files-from-specific-sharepoint-folders-in-power-automate/ 

https://tomriha.com/how-to-copy-sharepoint-files-including-folder-structure-in-power-automate/#comme...

 

PowerAutomateFlow_LI.jpg

4 REPLIES 4
abm
Super User
Super User

Hi @eisbaum 

 

Believe you getting this error while saving the flow? What's in your IF condition expression?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
eisbaum
Regular Visitor

Hello @abm 

I added this according to the blog instruction: 

length(split(items('Apply_to_each')?['{Path}'],'/')) is equal to 3 

provided that if the length(…) of the file path is equal to 3, it’s the root folder (the folder that contains "deliverable" in the name). The target SP library has a folder structure that goes "Shared Documents / Project ID / "... Deliverables". 

 

I got the error after having saved the flow and running it. After a few tests, I found that without that condition, the flow I created does not copy all the folders having "deliverable" in the folder names, unfortunately. My flows are not working as intended at all. 

Hi @eisbaum 

 

Is your Filter Query from Get File Properties right?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
eisbaum
Regular Visitor

Hello @abm,

As I'm testing my flow step by step, I think the filter query needs a fix too.

Please see the screenshot of the flow. Filter query I used is "substringof": substringof('Deliverables', FileRef).  

My understanding is that this filter query will get files from the file path that contains "deliverables" (i.e., any folders or files that have "deliverables" in their name).  

eisbaum_0-1634605228560.png

 

When I run this flow, it ends successfully only to retrieve 10 files. But in reality, there are at least 16k items that should be retrieved as my intention. What am I missing? 

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,695)