cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Power-Tim
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
v-alzhan-msft
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
Gristy
Resident Rockstar
Resident Rockstar

try

 

substringof(FileLeafRef,'Test')

v-alzhan-msft
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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (46,184)