cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Moving files to a subfolder

Hi,

 

I receive on a daily basis a report on my email and I want to archive it on a SharePoint. This is working terrifically well but I am struggling on the archiving. 

 

Since going back to older files is a routine activity, I created a sub-folder called 'old versions' where I archive all previous files. So my setup is:

Folder

    > Subfolder

    > Current file

 

I created a new process that 1h before the e-mail gets the current file and saves it on the 'old version'. The main object is achieved and the current file is moved to the subfolder. My problem is that Power Automate also tries to move the subfolder to the subfolder and gives me an error for this activity (since it is impossible to move a subfolder to itself).

 

My question is: How can Power Automate ignore folders and only perform actions on files? My process design is:

 

Recurrence (every day) --> Get files (Properties only) --> Apply to each --> Move File.

 

rafaelcosta_0-1600962601050.png

 

Thanks for any support!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Moving files to a subfolder

Hola!

I believe you can skip files whose attribute isFolder is true.

  • by adding a 'Condition' action block inside the Apply to Each or,
  • by adding an ODATA filter expression to 'Filter query' input of your 'Get files (properties only) or
  • by adding a 'Filter Array' action block just before 'Apply to Each'

 

Here you are a screenshot showing the first approach implemented

Flow_SkipFolders.png

 

Ánimo!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

3 REPLIES 3
Highlighted
Dual Super User III
Dual Super User III

Re: Moving files to a subfolder

Hola!

I believe you can skip files whose attribute isFolder is true.

  • by adding a 'Condition' action block inside the Apply to Each or,
  • by adding an ODATA filter expression to 'Filter query' input of your 'Get files (properties only) or
  • by adding a 'Filter Array' action block just before 'Apply to Each'

 

Here you are a screenshot showing the first approach implemented

Flow_SkipFolders.png

 

Ánimo!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
New Member

Re: Moving files to a subfolder

It worked like a charm! I am leaving a screenshot in case other people get the same issue.

 

rafaelcosta_0-1600963979326.png

 

Highlighted
Dual Super User III
Dual Super User III

Re: Moving files to a subfolder

That's the spirit!

Mil gracias! Many thanx for contributing to this community!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,378)