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

How to move a single folder at flow

Hi,

Will the challenge I am facing is:

. I have one folder (folder 0 will name it) with multiple folders in it, and new folders will keeping added  to folder 0 all the time.

. I need power automate desktop to move the oldest folder from folder 0 to another folder, do the flow and finish it, then start all over with the 2nd oldest folder.

 

Can this be done?

1 ACCEPTED SOLUTION

Accepted Solutions
Nived_Nambiar
Resolver I
Resolver I

Hi @Ishaq 

It is possible

 

I think u had to move oldest folder one by one at every time.

 

So for that i had constructed a workflow

 

Nived_Nambiar_0-1627125298525.png

 

Here first i read all folders jn a folder using Get Subfolder from folders actions and store the list of folder in Folders variable

Here i had set the properties like this 

Nived_Nambiar_1-1627125422318.png

 

 

Main thing u had to note is u had to select the sort by option as shown in figure

 

2. Next set a variable i with value as  with set variable action.

 

3. use the loop with condition action with the following parameters

Nived_Nambiar_2-1627125516419.png

 

 

You can change the condition for this as need, here i had put the condition to move the oldest folder from folder one by one.

 

 

now inside the loop, do the following things:

 

Nived_Nambiar_3-1627125590114.png

 

 

a. Use move folder to move the folder to destination folder, properties for this need to set like below

Nived_Nambiar_4-1627125642768.png

 

%Folders[0]% represent the oldest folder from the list %Folders%

 

Now after this action, use Increase variable by action to increment the %i% by one

Nived_Nambiar_5-1627125724341.png

 

 

Now after that use the remove item from list action with following properties

Nived_Nambiar_6-1627125760065.png

 

 

This is the way u can try around,

 

Hope you got the logic,

Mark it as solution if it helps!!!!!

 

Regards,

Nived N

View solution in original post

1 REPLY 1
Nived_Nambiar
Resolver I
Resolver I

Hi @Ishaq 

It is possible

 

I think u had to move oldest folder one by one at every time.

 

So for that i had constructed a workflow

 

Nived_Nambiar_0-1627125298525.png

 

Here first i read all folders jn a folder using Get Subfolder from folders actions and store the list of folder in Folders variable

Here i had set the properties like this 

Nived_Nambiar_1-1627125422318.png

 

 

Main thing u had to note is u had to select the sort by option as shown in figure

 

2. Next set a variable i with value as  with set variable action.

 

3. use the loop with condition action with the following parameters

Nived_Nambiar_2-1627125516419.png

 

 

You can change the condition for this as need, here i had put the condition to move the oldest folder from folder one by one.

 

 

now inside the loop, do the following things:

 

Nived_Nambiar_3-1627125590114.png

 

 

a. Use move folder to move the folder to destination folder, properties for this need to set like below

Nived_Nambiar_4-1627125642768.png

 

%Folders[0]% represent the oldest folder from the list %Folders%

 

Now after this action, use Increase variable by action to increment the %i% by one

Nived_Nambiar_5-1627125724341.png

 

 

Now after that use the remove item from list action with following properties

Nived_Nambiar_6-1627125760065.png

 

 

This is the way u can try around,

 

Hope you got the logic,

Mark it as solution if it helps!!!!!

 

Regards,

Nived N

Helpful resources

Announcements
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 tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,448)