cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Search in Sharepoint for a file contaning a string

I'm building an automated flow for a shared mailbox. Once you receive an e-mail with a specific theme - flow searches for a file in a sharepoint folder containing string from a theme of a mail.

Files containing searchable string are in PDF format.

1 ACCEPTED SOLUTION

Accepted Solutions

Oh sorry if I miss understhand, you have just one way and is using sharepoint search API

 

_spPageContextInfo.siteAbsoluteUrl+"/_api/search/query?querytext='contenttype:"+cntType+"'&path:'"+startingUrl+"

 

https://sharepoint.stackexchange.com/questions/116006/search-documents-contents-using-sharepoint-201...



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

5 REPLIES 5
ChristianAbata
Super User
Super User

hi @Anonymous  if I understand well you need to search for a file inside sharepoint folder if the subject of the email arrived is equals to sime value.

 

Unfortunally what you need to do is get files, but the propertie File name is not supported to get by ODATA, see the link bellow

 

https://powerusers.microsoft.com/t5/Building-Flows/ODATA-Query-for-Get-Files-Filename-NOT-Title/td-p/168293



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

@ChristianAbataNot actually.

 

As an example I recieve a letter containing number of order.

And I have a list of files named PP-31134-3zqw31-e31.pdf. Those names are random, but in the file I have a string with a number I need to find.

So once I recieve an e-mail with a number of order - I search in Sharepoint for that file and send back to user found file.

 

I did it before with a "find files in folder" for OneDrive for business, but this is not the best idea to use it for a business process. So I was searching how to do that with a Sharepoint.

 

The only thing I found so far is to use "Send HTTP request to Sharepoint" using get option to find file. But I don't know to use it.

 

When I try to find file manually using regular search on Sharepoint it founds file easily.

Search in SP.PNG

@Anonymous  I undernstand an sorry my friend as I told you wat you need to  get the files into sharepoint is this action

 

example.PNG

 

so Filter Query is the way that you have to get an specific value or in this case a specific file. But as you see in the post that I added you, so search by name is not supported.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Anonymous
Not applicable

@ChristianAbataI need to find not a name of file, but some text inside the file.

 

For examle - file name 123.txt.

 

But in that file there is a string with a test; Order number - XXXXX. and this XXXXX - is what I'm looking for.

As I understand in Odata you can filter files by it's parameters (like when it's created|modified)...

Oh sorry if I miss understhand, you have just one way and is using sharepoint search API

 

_spPageContextInfo.siteAbsoluteUrl+"/_api/search/query?querytext='contenttype:"+cntType+"'&path:'"+startingUrl+"

 

https://sharepoint.stackexchange.com/questions/116006/search-documents-contents-using-sharepoint-201...



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,306)