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 or Empty New Bar...
Power Apps
Unanswered

Reset or Empty New BarcodeReader?

(0) ShareShare
ReportReport
Posted on by 114

I am trying to find a way to reset or empty or clear the new BarcodeReader data.  (BarcodeReader1.Barcodes,Values).  Sometimes we don't need to scan a barcode for an item.  On these occasions we notice that it is reading the values from the last scans.  I don't see a reset or clear function to erase memory.  Below are the 2 functions we currently use to get barcodes scanned for an item.

 

ClearCollect(colDistinct,Distinct(BarcodeReader1.Barcodes,Value));
Set(TallyAsset,Concat(colDistinct,Value,"|")); 

 

when we leave the screen and come back into it i need to be able to remove the lasted used scans.  Ideas?

Categories:
I have the same question (0)
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    To clear the data stored in the BarcodeReader control in Power Apps, you can use the ClearCollect function with an empty collection to reset the stored values. Here's an example of how you can clear the scanned barcodes:

     

    ClearCollect(BarcodeReader1.Barcodes, {}); // Replace BarcodeReader1 with the name of your BarcodeReader control

     

    By passing an empty collection ({}) as the second argument to ClearCollect, you essentially overwrite the existing Barcodes collection with an empty collection, effectively clearing the stored barcode values.

    You can place this code in an appropriate event or action, such as when leaving the screen or when a button is clicked, to clear the barcode values before returning to the screen or performing another action.

    After executing the ClearCollect function, the BarcodeReader control will be empty, and any subsequent scans will populate the Barcodes collection with new values.

    Make sure to replace BarcodeReader1 with the actual name of your BarcodeReader control in your app.

    I hope this helps! Let me know if you have any further questions.

  • Jakub1987 Profile Picture
    19 on at

    Hi Shaheer, 

    Where exactly this formula must be placed?

    ClearCollect(BarcodeReader1.Barcodes, {}); // Replace BarcodeReader1 with the name of your BarcodeReader control

     

  • Thor_PPC Profile Picture
    365 on at

    This isn't working for me. I get the error "The first arguement of 'ClearCollect' should be a collection"

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard