cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bobbybob
Helper II
Helper II

Power app barcode scanner to verify right item

I need to make an app that has a barcode scanner to verify the right item is attached to the right area. My plan is to have everyone open the app, select the area they're in from a drop down menu and scan the barcode to verify that is the right one for that area. I have only 10 possible barcodes but I have more than 30 areas. Some barcodes are assigned to multiple areas. Is there anyway to have the app verify the correct barcode for a given area? And can I have the app alert the user if it is or isn't the right barcode? 

I'm not sure this is even possible but I thought I'd ask. Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
rubin_boer
Super User
Super User

hi @bobbybob 

 

Consider this:

  • you have a  Barcode Scanner control: BarcodeScanner1
  • you have a  ComboBox control:  cbSelectBarcCodeLocation
  • you have a label: lblSelectLocationBarCode

With the barcode scanner control set the  OnScan = Set(varScannedValue, BarcodeScanner1.Value)

Once you selected the control and scanned you image the value of the code will be stored in the variable varScannedValue.

 

Now that you have the scanned value you want to check whether the barcode is in the right place.

 

Assumption:

You have a table which have a column called location and an associated barcode. something like this

location   |   barcode

Place 1     |   123456

Place 2     |  111111

Place 3     |  555445

Place 4     |  123456 

 

This is as source to a dropdown and the location as the primary text. 

have the following for cbSelectBarcCodeLocation's:

Item = yourReferenceTable

OnChange = Set(varReferencedValue, Self.barcode)

Once a location is selected the variable will store the associated barcode.

 

All you have to do now is to compare varScannedValue = varReferencedValue 

 

If true the barcode is in the right place if false then its not

 

Hope this helps,

R

 

 

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

View solution in original post

7 REPLIES 7
rubin_boer
Super User
Super User

hi @bobbybob 

 

Quick answer is yes.

 

Now to get to it. you will need a reference table to evaluate the scanned code and area to be indeed where you expected it to be. the same evaluation can be used to notify the user visually of the mismatched.

 

Steps

  1. Your reference Table will have something like a id, area, qrcode for example {id: 0, area: "main warehouse", qrcode: "AJF-VVVT01"}. (If you going to have a small sample like that and it is going to remain static for most of the time you can build that table as part of the onstart event.)
  2.  In your app have a dropdown and set its datasource to the table you created.
  3. Create a variable to store the value of the qr code (varSomeBarCode)

 

When a user select an area the table also contains the qrcode you expect to see.  When the user scan the qr/barcode value will now be available in the variable. You can compare varSomeBarCode = yourDropdown.select.qrcode and if its false you can let the user know that the barcode is not in the expected area.

 

Once you start building your app and need some help with the code bits, lets us know.

 

Hope it helps,

R

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

Hello, @rubin_boer 

 

Ok I have created a list which includes the barcode and location. I've also created in the app a cascading dropdown to populate the barcode based on the location. Now I just need help configuring the formula to identify whether the barcode that was populated is the one scanned. Please and thank you! 

rubin_boer
Super User
Super User

hi @bobbybob 

 

Consider this:

  • you have a  Barcode Scanner control: BarcodeScanner1
  • you have a  ComboBox control:  cbSelectBarcCodeLocation
  • you have a label: lblSelectLocationBarCode

With the barcode scanner control set the  OnScan = Set(varScannedValue, BarcodeScanner1.Value)

Once you selected the control and scanned you image the value of the code will be stored in the variable varScannedValue.

 

Now that you have the scanned value you want to check whether the barcode is in the right place.

 

Assumption:

You have a table which have a column called location and an associated barcode. something like this

location   |   barcode

Place 1     |   123456

Place 2     |  111111

Place 3     |  555445

Place 4     |  123456 

 

This is as source to a dropdown and the location as the primary text. 

have the following for cbSelectBarcCodeLocation's:

Item = yourReferenceTable

OnChange = Set(varReferencedValue, Self.barcode)

Once a location is selected the variable will store the associated barcode.

 

All you have to do now is to compare varScannedValue = varReferencedValue 

 

If true the barcode is in the right place if false then its not

 

Hope this helps,

R

 

 

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

Hello @rubin_boer 

 

I set up the location as a dropdown box not a combo box. Will that cause future issues? Can I use your current formulas with a dropdown box instead? 

rubin_boer
Super User
Super User

hi @bobbybob the principle is the same. with the dropdown make sure the value = yourLocation. The OnChange will stay the same with a little change: Set(varReferencedValue, Self.Selected.barcode)

 

😉

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

Thank you sooo much for your help @rubin_boer . The only part I'm a little confused on is how do I compare the selected barcode to the scanned barcode?

rubin_boer
Super User
Super User

hi @bobbybob 

 

Set(varCheckBarcodes, varScannedValue = varReferencedValue )

 

If varCheckBarcodes = true then they the same.

 

Regards,

R

hey there if you liked the post give it a thumbs up, and if it solved your question please accept it as a solution.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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