Hello,
I've looked at about every IF and OR statement thread there is on this site and cannot find the exact answer to my issue. We had an app developer build the structure of an app for us and we are now making modifications based on requests from the users of the app. I currently have a gallery that searches (filters, but I'll use search in my thread) in two different text boxes for data in order to produce the results in the gallery. However, we need to be able to search multiple columns/fields in the SharePoint data source as part of this search. I will list the current formula that is only filtering from the ScanTag# column in the data source.
If(IsBlank(SearchPopupBarcodeScanLbl.Text),Filter('All Asset List', 'ScanTag#'=SearchTextBox.Text),Filter('All Asset List','ScanTag#'=SearchPopupBarcodeScanLbl.Text))
As you can see, it's currently looking at a text box (SearchPopupBarcodeScanLbl.Text) that is populated when scanning a barcode in and produces a result in the gallery if the scan result is found in the ScanTag# column within our data source (All Asset List). However, if the scan text box is blank, it searches for exact data that is manually entered into a separate text box (SearchTextBox.Text), where it will search the same column in our data source, and produce the desired result in the gallery.
The problem I'm having is that if the SearchPopupBarcodeScanLbl.Text box is empty, I actually need to search 2 additional columns if exact data is manually entered into the SearchTextBox.Text box. I'm not really sure if this would be accomplished by an Or statement, by stringing multiple arguments within the If statement, or something all together? I need it to search the ScanTag#, Serial#, and Holder Columns in our data source. I gave it a go with a couple awful attempts at using the Or function with no luck. PowerApps actually accepted the statement but said it might produce inconsistent data with large data sets, but didn't work nonetheless. I'm hoping someone can see my logic behind this, let me know if this can be accomplished, and how.
FIRST ATTEMPT If(IsBlank(SearchPopupBarcodeScanLbl.Text),Filter('AllAssetList','Holder'Or'ScanTag#'Or'Serial#'=SearchTextBox.Text),Filter('AllAssetList','ScanTag#'=SearchPopupBarcodeScanLbl.Text))
SECOND ATTEMPT
If(Or(IsBlank(SearchPopupBarcodeScanLbl.Text),Filter('All Asset List', 'ScanTag#'=SearchTextBox.Text);Filter('All Asset List', 'Serial#'=SearchTextBox.Text);Filter('AllAssetList','Holder'=SearchTextBox.Text),Filter('AllAssetList','ScanTag#'=SearchPopupBarcodeScanLbl.Text))
I will be more than happy to give additional info if needed, thanks.
Sean