Does anyone have a video or example on using flow with rest api to search sharepoint documents.
I have this one:
https://sharepains.com/2018/08/28/sharepoint-rest-api-power-automate/
are there anymore examples.
I need to search ppt and docx files.
Thanks
Dave
Not sure if you still need this, but I was working on the same thing. The way I did it was by modifying the querytext to go to only the Site Pages library.
/_api/search/query?querytext='path:https://contoso.sharepoint.com/sites/<sitename>/SitePages'&selectproperties='ViewsLifeTime,ViewsLifeTimeUniqueUsers'
HI @Expiscornovus ,
I just replicated your formula for the search query. The only thing which am curious about is that how can I modify your shared query formula if I wanna add a path to a sharepoint document library and search within that only? PLEASE HELP
Do you mean a gallery control within a Power Apps app by any chance? = Yes
I finally got the schema to work.
If I need to take this question further to powerapps I can. bUT I will also need to pass the query text parameters from powerapps..a textbox..on the screen.
Thanks
Dave
I got everything working so far...no errors and it is finding my text.
Thanks.
Hi @Anonymous,
The compose action was just an example. You could use that expression in other type of Power Automate actions.
Just to double check, what kind of gallery are you talking about? Do you mean a gallery control within a Power Apps app by any chance?
ok, what exactly do I do with the Compose part ?
I need the result to go into a gallery
Hi @Anonymous,
You can replace the text between the single quotation marks after the querytext parameter.
If you just want to look for that phrase in all file types that would be:
_api/search/query?querytext='Communication Strategy'&selectproperties='Title,Author'
If you are looking for a Word document with that phrase it would be:
_api/search/query?querytext='Communication Strategy filetype:docx'&selectproperties='Title,Author'
If I wanted to search for a phrase "communication strategy".. where would that go in the example ?
dave
Hi @Anonymous,
You can for example use the SharePoint Search REST API for this:
Below is an example which is using for the following keywords 'test filetype:docx'. Because I am adding filetype:docx SharePoint knows it has to look for a docx in the filetype field.
_api/search/query?querytext='test filetype:docx'&selectproperties='Title,Author'
The structure of the response json is a bit more complicated, a lot of nested json 😁
Below is an example of an expression which collects the first item of the search result set.
outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['query']['PrimaryQueryResult']['RelevantResults']['Table']['Rows']['results'][0]['Cells']['results']
Hope this helps to get you started 🙂
WarrenBelz
146,594
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional