How to detect Duplicated Barcodes inside CSV files
It works by archiving barcodes to a CSV file (server-side) and when the same barcode is scanned twice, the server checks whether it is present in such a file, and if so a warning is shown in the app interface.
The Output Template
The components sequence, looks like this:
➡️ It contains a BARCODE component to instruct the app to acquire a barcode.
➡️ The CSV_LOOKUP component is used to search the barcode value inside a CSV file.
Note that both components have the Skip output option turned on to prevent them to affect the Keyboard Emulation and CSV Output.
➡️ After that, there are two IF sections, the first one tests if the lookup produced some result, and the second one checks the other way around.
➡️ If no barcode is found the JAVASCRIPT FUNCTION component, will then output the barcode
variable.
This is where the magic happens, because, thanks to an option that we’ll enable later the output will be redirected to the same CSV file we’re using as input.
➡️ If instead, the search produced some result a sound and a visual alert will be shown on the app.
🧐 Did you get lost?
Don’t worry, you don’t have to understand how it works. Just follow the instructions below.
Instructions
Step 1 – Download & Import the template
Download the template file –> CheckDuplicated.btpt
Then double-click on it. (The server will automatically import it to the settings page)
Step 2 – Adjust the CSV file path
1. Open the server settings by clicking the gear icon
2. Select the imported template “CheckDuplicated”, and click on the CSV_LOOKUP component
3. Type the “CSV Input file path” that you want to use as database
4. Enable the “Append to a .csv file” option and set the same file path
Like this:
☝️ Suggestion: use a simple path such as
C:\data.csv
to avoid typos. Once you get it to work change it to whatever path you want.
Step 3 – Scan from the smartphone
Open the app, tap the scan button (camera icon) and select the correct Output template:
The first time you’ll scan a barcode, it’ll be automatically accepted and archived.
When the same barcode is scanned a second time, since it’ll be already inside the CSV file, you’ll get an alert message with a sound alert.
In this example, the barcode 12345
is accepted when acquired the first time, and is then blocked with an error message when is acquired the second time:
Step 4 – (Optional) Disable Keyboard Emulation
If you’re using Barcode to PC only to collect the data inside a CSV file, and don’t want the output to interfere with other programs, you may want to disable the “Enable Keyboard Emulation” option from the server settings:
Step 5 – (Optional) change the beep sound
If you don’t like the sound, you can change it by clicking the green BEEP component on the server settings:
Buongiorno, riguardo all’uso con Windows 10 su un foglio Excel, vorrei chiedere se oltre a inserire automaticamente i numeri del barcode, in altre celle di Excel eventualmente predisposte inserisce anche il nome del prodotto o le principali caratteristiche ventualmente presenti all’interno del barcode.
Grazie.
Salve, se i dati sono già presenti all’interno del codice allora è possibile estrarli come spiegato qui, altrimenti bisogna effettuare un lookup in un database (es. file csv), oppure integrare un servizio di lookup come spiegato qui