cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
colbyturybury
Helper V
Helper V

Include a barcode scan in search criteria

I have 3 drop downs that have various choices. As you choose more options the the search narrows. I am now wanting to add a barcode scanner into the mix but keep having trouble. Any help would be greatly appreciated.

 

Filter(
USD259_Equip_Assess_DB,
('Barcode Number' = SearchBarcodeScanner.Value || SearchBarcodeScanner.Value = Blank()) &&
('Building Name'.Value = cbxSearchSchoolName.Selected.Value || cbxSearchSchoolName.Selected.Value = Blank()) &&
('Select Discipline'.Value = cbxSearchDiscipline.Selected.Value || cbxSearchDiscipline.Selected.Value = Blank()) &&
('Select Electrical Equipment Type'.Value = cbxSearchEquipmentType.Selected.Value || 'Select Mechanical Equipment Type'.Value = cbxSearchEquipmentType.Selected.Value || cbxSearchEquipmentType.Selected.Value = Blank())
)

6 REPLIES 6
RandyHayes
Super User
Super User

@colbyturybury 

Please consider changing your Formula to the following:

Filter(USD259_Equip_Assess_DB,
   (IsBlank(SearchBarcodeScanner.Value ) || 'Barcode Number' = SearchBarcodeScanner.Value) &&
   (IsBlank(cbxSearchSchoolName.Selected.Value) || 'Building Name'.Value = cbxSearchSchoolName.Selected.Value) &&
   (IsBlank(cbxSearchDiscipline.Selected.Value ) || 'Select Discipline'.Value = cbxSearchDiscipline.Selected.Value) &&
   (IsBlank(cbxSearchEquipmentType.Selected.Value ) || 'Select Electrical Equipment Type'.Value = cbxSearchEquipmentType.Selected.Value || 'Select Mechanical Equipment Type'.Value = cbxSearchEquipmentType.Selected.Value)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I forgot one major item. When I place the barcode scanner code with the the other three search dropdowns(School Name, Discipline, Equipment Type) all of results disappear. I need it to bypass the barcode scanner value if it is blank. Basically what is needing to happen is a person scan a barcode and the result shows up in the gallery or they Use the three dropdowns(combo boxes) filtering the results to what has been chosen.

Here is the result when no search criteria has been entered without the barcode code.

colbyturybury_0-1639004180161.png

Here is the result when adding the barcode code in with no scan being provided. There is only one record with a barcode number in the database which is what should be coming up.

 

colbyturybury_1-1639004248037.png

 

RandyHayes
Super User
Super User

@colbyturybury 

That logic you are talking about is all in the formula provided.

If the barcode scanner value is blank, then the first part of the logic will be true.  That is then And'ed with the remaining logic items.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@colbyturybury 

A little confused on your statement.  It seems you are stating that the gallery should be showing the one item with the barcode, but you mentioned that no barcode value was scanned.

AND...are you sure there is no value?  If it has been used and not reset, then it will have a value.  I would throw a label on the screen to test and set the text property to SearchBarcodeScanner.Value to be certain.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
colbyturybury
Helper V
Helper V

I discovered the error. It was merely the order for what it was searching for. By placing the barcode function as the last function everything stays visible until you provide the scanned barcode. Then the that sole record with the correct barcode is shown.

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (2,623)