cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stevenls
Helper IV
Helper IV

Using a wildcard when finding a file

Hi there,

I have a flow that picks out our crew plans when they are put into the resourcing folder on sharepoint and moves them to my onedrive for Power BI to pull information from.

The issue is there are two files per week, one is a static name and the second one has the date the file is put into the folder.  There are other files put in as well which I am not interested in so I need to pull out specific files.

I have a Get file content using path for the fixed name file and that works fine when I have that in the 'File Path' section

/Shared Documents/General/Current_Crew_Projection.xlsx

 

but I need to also need to grab

/Shared Documents/General/Current_Crew_Projection_<date here changes>.xlsx

 

Putting in an * didn't work as I was hoping it would, is there a way to wild card this one?

 

Thank.

2 ACCEPTED SOLUTIONS

Accepted Solutions
ekarim2020
Community Champion
Community Champion

You can use a filter query to select file names beginning with 'Current_Crew_Projection_':

ekarim2020_1-1632781326228.png

This is the filter query and uses the Document Library's internal name FileLeafRef - which gives us the name of the file including its extension:

 

startswith(FileLeafRef,'Current_Crew_Projection_')

I then use an Apply to each loop for copy each file to a folder called 'delete' (the get file content action below is not needed in the flow):

2021-09-27_23-24-12.jpg

File names beginning with 'Current_Crew_Projection_' are moved to a folder called 'delete':

ekarim2020_3-1632782244901.png

 

ekarim2020_4-1632782300375.png

Ellis

 

 

____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

 

View solution in original post

ekarim2020
Community Champion
Community Champion

D031ED73-4918-4502-8F41-4C1C0ED100DD.jpeg

Try setting the Include Nested Items to False and re-test.

Ellis

View solution in original post

5 REPLIES 5
ekarim2020
Community Champion
Community Champion

You can use a filter query to select file names beginning with 'Current_Crew_Projection_':

ekarim2020_1-1632781326228.png

This is the filter query and uses the Document Library's internal name FileLeafRef - which gives us the name of the file including its extension:

 

startswith(FileLeafRef,'Current_Crew_Projection_')

I then use an Apply to each loop for copy each file to a folder called 'delete' (the get file content action below is not needed in the flow):

2021-09-27_23-24-12.jpg

File names beginning with 'Current_Crew_Projection_' are moved to a folder called 'delete':

ekarim2020_3-1632782244901.png

 

ekarim2020_4-1632782300375.png

Ellis

 

 

____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

 

View solution in original post

Perfect, thank you for the detailed reply.  I will have a look at this now and make the changes needed.


Cheers

stevenls
Helper IV
Helper IV

@ekarim2020   I found one problem with this.  In Documents>General where these files get put there is also an Archive folder.  When this flow triggered this morning, 500 files copied across also as it copied all the archive ones over.
Is there a way to exclude folders?

ekarim2020
Community Champion
Community Champion

D031ED73-4918-4502-8F41-4C1C0ED100DD.jpeg

Try setting the Include Nested Items to False and re-test.

Ellis

View solution in original post

stevenls
Helper IV
Helper IV

Thank you, that makes perfect sense.  Will try it out later today.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (3,362)