cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Search SharePoint Site for file

I am trying to search a SharePoint site document library for files containing  containing a string in the file name.   I am not having much luck.    I am trying to using a "get files (properties only)" step with a filter query, but not having any luck.    I can see the file with the string in it, I'm searching the right library, not sure the issue.   Here is the query syntax I've tried below, plus several other variations.

 

substringof('Test',FileLeafRef)

substringof('Test',Title)

substringof('Test',Name)

 

 

Any suggestions will be helpful.    What I want to do is get a file, with key word in the name and do something with it in a flow.   The name will change, but always contain a key string.    If there is a better way to get that file, that would solve the problem also.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Power-Tim ,

 

Please add a Filter Array action under the get files action to filter the files:

1.png

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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
Resident Rockstar
Resident Rockstar

try

 

substringof(FileLeafRef,'Test')

Community Support
Community Support

Hi @Power-Tim ,

 

Please add a Filter Array action under the get files action to filter the files:

1.png

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

That seems to work but, with large libraries it times out or hits the 5000 limit.    I'd like to get the query going to limit the amount of data being uses.     

Check this, when I run a get file command(properties only), the Name and filename with extension come out with number instead of actual file names.  I ran a compose step to output returned name and filenames with extensions.   I got a few folder names, but most were numbers.   So i scrolled the the get files step output.  Below are a few examples of where I thought filenames would exist.

 

{Name}":"11"
{Name}":"18"
{FilenameWithExtension}":"11"
"{FilenameWithExtension}":"18"

 

I believe I have the solution.   I used a conditional statement to remove all the junk and did find the filenames.   I would still like that query to work, I think it would speed the process but I now have a functional work around.

 

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (2,384)