cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Goodmountain
Frequent Visitor

Move folders from sharepoint to sharepoint using jokers

Hello,

 

just challenging a probably simple issue:

 

MS Flow collects daily e-mail-attachements in a sharepoint, creating folders like '2018-07-01', '2018-07-02' and so on. After a few weeks, a pretty long list of folders can be seen in my sharepoint. This is more and more confusing.

So my goal was to copy older folders on a regular basis to an additional folder called 'Archive' and delete the copied folder afterwards. Perhaps, this was too oldschool, these features semm not to be implented in MS Flow.

So, I took a detour copying the e-mail-attachements in the folders mentiones above and directly into the folder 'Archive'. This works, but I have to get rid of the old folders.

Perhaps it is possible to move the folders, so I created a folder called 'Trash' und tried to move the old folders to it.

This works when I directly address the folders name, but when I try to user jokers like '?' or '*', an error is returned:

 

BadGateway.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I tried to use 'concat' adding the question marks to the folder path in the step 'Move folder' like this:

 

Concat.png

 

 

 

 

 

 

 

 

 

 

 

 

 

The example above ist with '-??' it doesn't work with '-*' either.

 

Do you have an idea how to use jokers in this action to copy the whole month july - '2018-07-*'??

 

Thanks in Advance,

 

Goodmountain

2 REPLIES 2
v-bacao-msft
Community Support
Community Support

Hi @Goodmountain,

 

I am afraid it is impossible to use the jokers like '?' or '*' matching date to determine the folder name to move.

The content filled in the Move to folder must be able to determine the name of the folder. Obviously, using your method, the final directory name is invalid or does not exist.

Maybe you could consider creating an array to store all the days of a month to it, then traversing the array and populating the date (folder name) in the Move to folder.

You could refer to the method provided by v-xida-msft in this link to get all the dates in a month. Then store them in an array and traverse the array via Apply_to_each.

https://powerusers.microsoft.com/t5/Building-Flows/Dates-between-two-dates/td-p/73128

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Barry,

 

that sounds interesting, I will check in quiet minute - thanks a lot!

 

Best regards,

 

Goodmountain

 

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,461)