Scott Schechtel
Posts: 0
Joined: Tue Jul 23, 2013 5:23 pm

barcode scanner to invoke data from database

I would like the app to have a barcode scanner feature that scans a barcode which opens up more specific data on a product, i.e. expanding on just the sku and type. I need it to query info from a database. Help is appreciated!

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

barcode scanner to invoke data from database

You would need to do GET requests with queries: http://docs.appery.io/documentation/r...
Also examine the following http://docs.appery.io/documentation/b...

Scott Schechtel
Posts: 0
Joined: Tue Jul 23, 2013 5:23 pm

barcode scanner to invoke data from database

Okay but wouldn't I need to modify the Barcode service plugin? I want to edit where it displays 'text, format, cancelled' to instead echo Wine name, SKU, price, description. Can you guide me on how to do that here?:

curl -X GET \
-H "X-Appery-Database-Id: 52433827e4b04f1851bcb2d1" \
[-H "X-Appery-Session-Token: "] \
https://api.appery.io/rest/1/db/colle...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

barcode scanner to invoke data from database

Hello! No, you don't need to change plugin. Not sure I understand the question. When you scan barcode you retrieve text. What that text is - product name, product id or something else? In any case using this information you'll send request to DB. If after scanning code you retrieve not just id or product name then using JS you can break apart response and using needed part of response create a request to DB.

Scott Schechtel
Posts: 0
Joined: Tue Jul 23, 2013 5:23 pm

barcode scanner to invoke data from database

Is there a tutorial on this? I just want the barcode scanner to open up another screen that displays the specific info on the product that is in the db. It looks like a second step would be needed in order to view the detailed information after scanning. I can send a brief sequence of screenshots if you like to further explain what I mean..

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

barcode scanner to invoke data from database

Unfortunately there is no such tutorial, but if you'll post sample of response and describe DB collection structure we'll try to help.

Scott Schechtel
Posts: 0
Joined: Tue Jul 23, 2013 5:23 pm

barcode scanner to invoke data from database

Okay here's a couple screen shots from the builder and the basic dbase structure. Hope this helps you help me :)

Screen 1
Screen 2
dbase structure

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

barcode scanner to invoke data from database

Hi Scott,

1) _id is the best parameter for using as SKU.
2) You can delete Product_no if you don't need it.
3) It's better to store images in database: http://docs.appery.io/tutorials/uploa...
4) If all your categories are like "Argentina", it is better to add another field "country", and keep all records in one collection. This would simplify the application.

Scott Schechtel
Posts: 0
Joined: Tue Jul 23, 2013 5:23 pm

barcode scanner to invoke data from database

So for 4) I just add a column for "country" and it will contain Argentina, France, germany, US, Australia, etc..?

Also how do I set up app to show screen 2?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

barcode scanner to invoke data from database

Scott,

You should add Datasource for barcodescanner, and on its Complete event add "Navigate to page" action.

Return to “Issues”