Flow allows you to easily manipulate your SharePoint content. However, as I discussed in my previous article Manipulating SharePoint content using Flow, there are times where the basic actions will not suffice.
The Send an HTTP request to SharePoint action enables you to design your specific queries to perform various content management actions. Some common scenarios include creating, modifying, and viewing items and documents in lists and libraries. In some instances, however, you may need to leverage the SharePoint REST API to perform a search. One way to structure the search is by using a Collaborative Application Markup Language (CAML) query. Here’s how you do it…
Perform the Search
- Site address – the site where your list or library resides
- Method – make sure it’s set to POST
- Uri – You need to change the items in red for your specific needs
_api/web/Lists/GetByTitle(‘[Your list name]‘)/GetItems(query=@v1)?@v1={“ViewXml”:”[Your CAML query]“}for example, in my case, I’m searching for items that contain my search string (search) in either the Title and Description fields from a list called FAQ. @{triggerBody()?[‘search’]} is the search term being passed into the Flow.
_api/web/Lists/GetByTitle(‘FAQ‘)/GetItems(query=@v1)?@v1={“ViewXml”:”@{triggerBody()?[‘search’]}@{triggerBody()?[‘search’]}500“}

