In this video, Matthew Peterson provides a solution for fixing issues with the search function in Canvas Power Apps. Recently, some users have experienced problems where the search feature that previously worked fine suddenly fails to return results, especially with certain data sources. Matthew walks through a practical workaround to resolve this issue by using a global variable and a simple trick to simulate user interaction with the search field.
Search functionality in Power Apps typically works by allowing users to type text into an input field, which filters data in a gallery based on the entered text. However, there have been recent reports where the search function appears to be "stuck," and no results are returned, even when the input field is used correctly. This issue is primarily seen with delegable data sources like SQL, where Power Apps relies on the data source to handle the search operation.
To work around this bug, Matthew introduces a simple solution using a global variable. The idea is to "trick" the input control into behaving as if a user had typed something and then erased it, causing the gallery to reload correctly. Here's how it works:
Default
property.OnStart
property to automatically simulate the input of a character followed by its removal.OnStart
property, use Set(VAR_Search, " ")
followed by Set(VAR_Search, "")
to set the search input to a space and then clear it.Default
property of the search input control.OnStart
function to trigger the simulated input and force the search results to display properly.Matthew explains that this issue mainly affects data sources where search is delegable, such as SQL Server, meaning the data source itself performs the search. In non-delegable data sources, like SharePoint, Power Apps handles the search, and the issue may not appear. The workaround ensures that search functionality is restored, regardless of the data source.
If you've encountered problems with search in your Canvas apps, this video provides a quick and effective workaround to ensure your galleries display search results correctly. By using a global variable and simulating input, users can bypass the issue until a permanent fix is available.
Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Power Apps and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up to date on the latest tips and tricks.