web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Train the Barcode Scan...
Power Apps
Unanswered

Train the Barcode Scanner to only scan 1 type of barcode with 2 barcodes in view

(0) ShareShare
ReportReport
Posted on by 2

Hello there,

 

I have a barcode scanner that I want to read a specific barcode on a pallet label. The issue is the pallet label has 2 different barcodes on it.

 

I would like it to read the top barcode with 47 characters and ignore the bottom barcode. However, when both barcodes are in view, it seems to read the bottom barcode by default as it is shorter. The code below manages to ignore the barcode and post the warning message, but it also kicks the app out of scanner mode.

 

I would instead like it to stay on the scanner screen and only return a result once the Correct length barcode has been identified. Does anyone have any ideas how to achieve this?

 

I appreciate the help, Mark

 

If(Len(Self.Value)<45,Notify("You have Scanned the Wrong Barcode",Warning),Patch('QMS Checks Scanner', {Title: BarcodeScanner2.Value, 'Barcode Type': BarcodeScanner2.Type, 'Scanned Person': User().FullName, 'Scanned Time': Now()});Set(varScan, BarcodeScanner2.Value))

Categories:
I have the same question (0)
  • mhopus Profile Picture
    51 on at

    Edit: My apologies for misunderstanding. I was unaware of the whole barcode scanner control and it's nuances. My answer focused on a desktop browser scenario with a barcode reader impersonating a keyboard. 

     

    Original post:

    There might be something here I'm missing, but wouldn't it work as simply as this? After invalid input the text box resets to empty and focus stays on it so you can try to read the correct barcode:

     

    //text input OnChange
    //
    If(
     Len(Self.Text)<45,
     //Wrong barcode:
     Notify("You have Scanned the Wrong Barcode", Warning); Reset(Self),
     //Correct barcode
     Notify("Thank you.",Information)
    )

     

    barcode.gif

  • MarkHutton Profile Picture
    2 on at

    Not to worry.

     

    i believe the easiest way to achieve what I want is to set the barcode scanner to “Select to Scan” rather than Auto. I haven’t quite figured out how to do this yet, any ideas?

  • NkaMan Profile Picture
    4 on at

    Hi, sorry where do I write this code?

     

  • NkaMan Profile Picture
    4 on at

    Hi, sorry where do I write this code?

  • mhopus Profile Picture
    51 on at

    To the "OnChange" field of the text input.

    mhopus_0-1712759944806.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard