cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
livingstonep
Level 8

Flow - SharePoint Shared Docuiment Library - Deleting files

I am building a flow that must delete files from a SharePoint Shared Document Library which either are older than 30 days or match the filename of in the format "eBayITLabel_6507-00005_20190117_15_58.pdf"

The part of the filename that we would match would be 6507-00005 and that would be unique (the last 5 digits "00005" would increment one by one up to 99999...

 

Essentially we have that number in a sharepoint list, and every week we would run the flow, filter for the records in the list where status = certain values, and loop through those items, deleting all the files found that match the current string

 

so how do I search for files in the SharePoint Library using wildcards in the name like that?

 

I don't have any issues removing files older than 30 days, but would prefer to actually remove the files based on the name

 

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flow - SharePoint Shared Docuiment Library - Deleting files

Hi @livingstonep,

 

For example, configure Identifier of the filtered files in Delete file action.

Image reference:

39.PNG

 

Best Regards,

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.

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: Flow - SharePoint Shared Docuiment Library - Deleting files

Hi @livingstonep,

 

Currently, MS Flow does not support the use of wildcards and regular expressions.

Could you share more details about your Flow configuration?

Since you mentioned that these numbers are stored in the list, you could traverse the list with "Get items-Apply to each".

Then check if the file name contains the number contained in the current item.

If yes, delete the file.

Please take a try to configure your flow.

And if it doesn't work for you, please provide more details about your needs, we would provide proper workaround for you.

 

Best Regards,

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.
livingstonep
Level 8

Re: Flow - SharePoint Shared Docuiment Library - Deleting files

Hi,

 

Thanks for your help.

But the Delete method in SharePoint requires a File Identifier - how can we get that please?

Highlighted
Community Support Team
Community Support Team

Re: Flow - SharePoint Shared Docuiment Library - Deleting files

Hi @livingstonep,

 

Could you share a screenshot of your current Flow configuration?

I speculate that your Flow may contain Get files(properties only) action.

You could configure the Identifier it outputs in File Identifier field.

 

Best Regards,

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.
livingstonep
Level 8

Re: Flow - SharePoint Shared Docuiment Library - Deleting files

Hi,

 

yes we are using Get files(properties only) action

 

so how do we get the File Identifier that we need to plug into the SharePoint - Delete file action?

 

We want to delete these files from a SharePoint Shared Document Library

Community Support Team
Community Support Team

Re: Flow - SharePoint Shared Docuiment Library - Deleting files

Hi @livingstonep,

 

For example, configure Identifier of the filtered files in Delete file action.

Image reference:

39.PNG

 

Best Regards,

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.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,960)