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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,810)