cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stevenls
Advocate II
Advocate II

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
Resident Rockstar
Resident Rockstar

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
Resident Rockstar
Resident Rockstar

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
Resident Rockstar
Resident Rockstar

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
Advocate II
Advocate II

@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
Resident Rockstar
Resident Rockstar

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

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

Ellis

View solution in original post

stevenls
Advocate II
Advocate II

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

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (875)