cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ma_91
Helper I
Helper I

Delete SharePoint Excel Files after 7 days

Hey guys, quick question.

 

I'm trying to set up a flow which deletes only Excel files from a folder, but shouldn't delete specific file.

 

All files are ".xlsx" files and the one who shouldn't be touched is named "Template.xlsx" all the other ".xlsx" files can be deleted.

 

This is what I came up with so far, but I don't have any clue how I should continue:

 

Unbenannt.jpg

 

 

 

 

 

 

 

 

 

It is important that the Flow doesn't delete the "Template.xlsx" file, but any other ".xlsx" file.

 

Thanks in advance for your help guys!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @ma_91 

 

Here it is

 

Under the apply to each loop add a compose action to find the extension of the file. The expression I used is as follows:

 

last(split(items('Apply_to_each')?['Name'],'.'))

 

image.png



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

View solution in original post

6 REPLIES 6
abm
Super User
Super User

Hi @ma_91 

 

Please follow the below steps:

 

image.png



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
ma_91
Helper I
Helper I

hey @abm

thank you so much for your help.

your flow is indeed working, but it deletes any other file aswell. It should only delete ".xlsx" files.

 

Hi @ma_91 

 

I was only following your orders. This is what you mentioned earlier 🙂

 

All files are ".xlsx" files and the one who shouldn't be touched is named "Template.xlsx" all the other ".xlsx" files can be deleted.



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
ma_91
Helper I
Helper I

Hey @abm 

 

sorry, that was my fault.

 

How do I configure it to only delete ".xlsx" files not everything else?

Hi @ma_91 

 

Here it is

 

Under the apply to each loop add a compose action to find the extension of the file. The expression I used is as follows:

 

last(split(items('Apply_to_each')?['Name'],'.'))

 

image.png



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
ma_91
Helper I
Helper I

hey @abm,

 

thank you so much! I really appreciate it!

It worked 🙂 

 

Thanks for your help!

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.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (2,982)