The Power Apps Filter and StartsWithfunctions are very flexible and can be used to search single or multiple columns in a table
In this article I’ll show how to give users the option to choose which columns to search
Filter and StartsWith Functions
In the demo below, the user can decide whether to use the Country or Continent columns for their search via a Radio Button. This approach gives the option to drill down into the data to find a particular record, or if the user already knows what they are looking for, they can quickly cut through the mass of data
Below is the code assigned to the Items property of the Gallery
The If statement identifies which of the Radio Buttons has been selected and then uses the Filter and StartsWith functions on the selected column. SortByColumns sorts the filtered data first by the Continent column and then by Country
Alternatives and Further Options
Check Boxes could be used instead of a Radio Button to allow both columns to be used in the search, or more columns to be selected
The Search function could also be used instead of StartsWith to search within the full text of fields, rather than just at the start
This technique could also be combined with the cascading Dropdown Boxes described here to provide a really sophisticated search capability