Build a SharePoint Knowledge Search in Power Automate REST API + KQL

In this video I walk through a Power Automate flow that searches a SharePoint knowledge site and returns clean, structured results — scoped to a specific document library (SOPs, NCR Codes, Customer Specs, or all of them). Search SharePoint with Power Automate: postquery, KQL Path Filters & Clean JSON Output Querying SharePoint Search from Power Automate — Scoped Document Library Search Walkthrough Instead of the standard SharePoint actions, this flow calls the SharePoint Search REST API (_api/search/postquery) directly using "Send an HTTP request to SharePoint," so there's no premium connector required. I show how to build the query text, scope it to the right library with a KQL Path filter, and parse the raw key/value response into a tidy JSON output your apps or chatbots can actually use. What's covered: • Setting up an instant flow with Query, Scope, and Top Rows inputs • Sanitizing user input and normalizing the row count (clamped 1–25) • Building a dynamic KQL Path filter for each document library with nested if() logic • Calling the SharePoint Search postquery endpoint and the JSON formatting gotchas (quotes & escaping that trip everyone up) • Parsing the SharePoint "Cells" key/value array into clean fields (Title, Path, Snippet, LastModifiedTime, FileType, Score) using a Select action • Returning a structured response with a result count and a friendly message Example output the flow returns: { "Found": 9, "Query": "component", "Scope": "NCRCode", "Message": "Found 9 Results for the query component and scope NCRCode", "Results": [ ... Title, Path, Snippet, FileType, Score ... ] } body of the post { "request": { "Querytext": "querytext", "RowLimit": rowlimit, "SelectProperties": [ "Title", "Path", "HitHighlightedSummary", "LastModifiedTime", "SiteName", "FileExtension", "Rank" ], "TrimDuplicates": true, "EnableInterleaving": true } } This is a great building block for a SharePoint-backed Q&A bot, an internal documentation search, or feeding search results into Copilot Studio / a Power App. #PowerAutomate #SharePoint #PowerPlatform #Microsoft365 #KQL #SharePointSearch #lowcode #Office365 #SharePointOnline #RESTAPI #FlowTips #Automation #d365Phoebe #CopilotStudio #powerappsportals