I'm having some trouble searching a data table by various text inputs depending on certain circumstances. For example, I want to search the table by 'SearchBar1'.Text when a button is pushed, but by 'SearchBar2'.Text when the button is turned off. The following formula mirrors that in my app:
If( filterbuttonpressed,
Search('Table1', 'Search Bar1'.Text, "column1"),
Search('Table1', 'Search Bar2'.Text, "column1", "column2", "column3", "column4", "column5"))
)
I'm not getting an error with this code, but when filterbuttonpressed = true, I get no results when searching text through Search Bar 1 (and there should be records corresponding to my search text).
Does the search function not work within an If function?