cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Scan and Record Multiple Barcodes

Hi,

 

I'm creating an app where I would like to scan and record multiple barcodes. I need to be able to exit the barcode scanner in between scans as the barcodes won't necessarily be scanned continuously. Basically I need to scan a barcode, record to multiline text input then have the ability to scan additonal barcodes and have them record to the same multiline text input. 

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Continued Contributor
Continued Contributor

Pretty straightforward and I just tested to verify.  Drop your scanner button onto your app and change the OnScan code to be similar to the following:

Set(gScanData,gScanData & Char(10) & BarcodeScanner1.Value)

You can optionally drop in an If() to check if gScanData is empty so you don't get a Line Break at the beginning of course.

Then add a MultiLine Text field and set the Default to be gScanData.

 

View solution in original post

5 REPLIES 5
Highlighted
Continued Contributor
Continued Contributor

Pretty straightforward and I just tested to verify.  Drop your scanner button onto your app and change the OnScan code to be similar to the following:

Set(gScanData,gScanData & Char(10) & BarcodeScanner1.Value)

You can optionally drop in an If() to check if gScanData is empty so you don't get a Line Break at the beginning of course.

Then add a MultiLine Text field and set the Default to be gScanData.

 

View solution in original post

Highlighted

This works but since the first one variable is blank, I get a blank line first and then each barcode. Is there a way to remove that?

Highlighted

Probably along the lines of modifying it to use IsEmpty or IsBlank on gScanValue before the assignment.  Similar to:

If(!IsEmpty(gScanValue),Set(gScanData, BarcodeScanner1.Value),Set(gScanData,gScanData & Char(10) & BarcodeScanner1.Value))

 

Highlighted

I used this code and it works perfectly for scanning the barcodes, I have run into an issue though.

 

I am using the barcode scanner in an app that is used to keep a record of inventory transfers in a warehouse. I will attach a screenshot of the app so you can get an idea of how it is set up.

 

The only problem I am having is when the form is submitted and a new form is loaded the user tries to scan new barcodes and

the data from the previous scans are populating in my text field, along with the new ones. Wondering if you have had this issue or have a solution to my problem.

 

Thanks

 SystemTransfers Powerapps.png

Highlighted

Most likely is needing to clear your Form via either the ResetForm() command, or the Reset() command on an individual control, or set a Boolean and assign it to the Reset attribute for the individual controls involved and swap that Boolean from False/True (you have to make sure you change the value or it will not reset - just having it True won't work).  

 

Depending upon your application design, one (or more) of those will work.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,493)