cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
Super User II
Super User II

try

 

substringof(FileLeafRef,'Test')

Highlighted
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

Highlighted

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.     

Highlighted

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"

 

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (7,936)