How to play a Feedback Sound when a barcode is found inside a CSV file
If you want to check whether a specific barcode is present inside a CSV file by receiving a sound alert after scanning it with your smartphone, this is the guide for you.
Notice: if you want it to always emit a sound, check the “Enable camera beep” option from the app settings and make sure that the smartphone Media volume is turned up.
How it works?
- The app acquires the barcode and sends it to the server
- The server will search for the barcode value inside the specified CSV file
- The server will reply to the app with the search result
- The app will evaluate the result and emit a specific sound
The Output Template
It looks like this:
➡️ It contains a BARCODE component to instruct the app to acquire a barcode, and a CSV_LOOKUP component used to search the barcode value inside a CSV file.
➡️ Once a barcode is found it’ll write the search result to the csv_lookup
variable.
➡️ After that there are two IF sections, the first one tests the csv_lookup == "not_found"
condition and the second csv_lookup != "not_found"
.
The BEEP and ALERT components are used to create a sound and a pop-up message.
🧐 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 the Output template
Download the template file –> CSV Alert.btpt
Then double-click on it. (The server will automatically import it to the settings page)
Step 2 – Edit the CSV_LOOKUP component
1. Open the server settings by clicking the gear icon
2. Select the imported template “CSV Alert”, and click on the CSV_LOOKUP component:
3. Select the CSV Input file path that you want to use as database
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.
The file you provide can contain multiple columns, for example:
12345,Box
12346,Packet
12347,Envelope
12348,Bag
The lookup will be performed on the first column by default.
Step 3 – Scan from the smartphone
Open the app, tap the scan button (camera icon) and select the correct Output template:
Once you scan a barcode you’ll get an alert message with a sound alert.
In this example, the barcode 12345
is found and generates a Success message, and the 12340
barcode generates an Error message.
Step 4 – (Optional) Disable Keyboard Emulation
If you’re using Barcode to PC only to perform the barcode search, and you 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:
Can I use a beep to alert and not allow the amount to be entered?
IF it is in the csv, it allows you to enter the quantity, ELSE is in the csv, scan again
Yes, it can be done, you only need to enable the Skip Output option for the BARCODE component and add a JAVASCRIPT COMPONENT to output the
barcode
variable inside the IF/ENDIF block.Like this:
You can download this Output Template here: CheckQuantity.btpt
You’ll need to adjust the database path in both CSV_LOOKUP and Append to .csv file option, like shown here.
hello i am wondering how can i open a URL from scaning a barcode , for example; these is the URL .
http://www.example.com/test/ {{ barcode }}.JPG i want to open that image in that URL to see a picture if the code is correct how can i do it ?
See this: https://barcodetopc.com/output-template/opening-pdf-files-on-the-computer-by-scanning-barcodes/
Instead of using a file path, as explained in the tutorial, you can use an HTTP URL. For example, the correct command for Windows would look like this:
start "http://www.example.com/test/ {{ barcode }}.JPG"