Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Resetting Barcode Reader Control

(3) ShareShare
ReportReport
Posted on by 37
I building an app for product inspection and in my inspection form I have a datacard for Part Number and I wanted to use BarcodeReader control to scan the barcode and then display the scanned value in the Part number field. 
 
Therefore I am using the below formula in the default property of the the partnumber datacardvalue (Text Input Control)
First(BarcodeReader1.Barcodes).Value
 
However, I want to display the part number field empty in the new form but now it displays the previously scanned part number. 
How can I reset my Barcodereader control?
 
 
  
  • Verified answer
    DBO_DV Profile Picture
    DBO_DV 4,415 on at
    Resetting Barcode Reader Control
    Hey, 
     
    So i would not display the value directly from the Barcode scanner but use an ectra step. Save the value in a variable. 

    You have the property "OnScan", There you can enter this Formula: 
    Set(varBarcode,First(BarcodeReader1.Barcodes).Value)
    //or
    UpdateContext({varBarcode:First(BarcodeReader1.Barcodes).Value})
     
    You can choose if you never leave the screen when filling out the form you can use UpdateContext otherwise use the Set formula. 
    UpdateContext is cleare when leaving the screen. 
     
    If you use the set function just add after sending or canceling the form this: 
    Set(varBarcode,Blank())
     

    If this solved your problem, please mark it as Solved to help others find the solution faster.
    If you found it helpful, consider giving it a Like to support each other in this community!

    Thanks, and happy building!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard