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 / Reset Barcode Reader
Power Apps
Answered

Reset Barcode Reader

(1) ShareShare
ReportReport
Posted on by 8

We've been using the previous Barcode Scanner to add items to our form and when we submit the form it would save and reset the barcode scanner value. Since the introduction of the new Barcode Reader I can't work out a way to do this so any help would be appreciated.

 

Under the old integration there is no code added to the Barcode Scanner button, I just amended the field in the form to be If(IsEmpty(DataCardValue56), btn_SP_ScanIMEI.Value, Parent.Default) and the confirm button was SubmitForm('frm.SPEdit'); Back(); Reset(btn_SP_ScanIMEI)

 

Now I have to use First(btn_SP_ScanIMEI.Barcodes).Value in place of the btn_SP_ScanIMEI.Value in the first part but when it comes to saving the form the Reset doesn't work and I can't think of what code to use for it.

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @ulvgyov7ntiefmy,

     

    With the new Barcode Reader control simply resetting the .Barcodes output does not seem to be possible - it overwrites the previous output after a new scan has taken place. A quick and easy workaround would be saving the scanned data in a variable via the OnScan property and referencing that variable instead. After submitting you would just clear the variable and start fresh. (Should you want multiple scans, use a collection instead of a variable)

     

    The OnScan property would be:

    UpdateContext({varScannedItem: First(Self.Barcodes)})

     

    The Submit button (or OnSuccess of the form) will reset the variable:

    UpdateContext({varScannedItem:Blank()})

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Jap11 Profile Picture
    386 on at

    Hi @LaurensM  - Ive been stuck trying to work this out as well. I've used the OnScan property and OnSuccess you have recommend but think I'm missing a step...

     

    How do I reference the scanned variable in my text box? When I scan an item, I need it to display in this text box, and then when I submit the form, the text box resets.

     

    JoshPullan11_0-1685105247418.png

     

    Any help would be massively appreciated 🙂

     

    Thanks,

    Josh

  • Jean-Philippevb Profile Picture
    84 on at

    Hi Josh

     

    you could do this in several ways: the barcode reader will return a table with several records and Fields "Type" and "Value". if you would like a specific barcode to be returned you could do it

           - in the "on scan" property of the barcode reader like this: UpdateContext({VarScannedItem : First(Self.Barcodes).Value})   

         - Or you follow LaurensM advice, and in the textbox you use VarScannedItem.Value

     

     

    Kind Regards,

  • nmagee Profile Picture
    25 on at

    Yes, but how does the variable get reset when you navigate back to the barcode scanner screen?

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard