Preston To
Posts: 0
Joined: Thu Jun 18, 2015 12:35 pm

List scanned items

I'm working on an app which combines the barcode scanner with an email service. I scan a barcode, the code then populates a text box, which then will be sent out as the body of an email.
As of now, I can only have one code per email, since the scan of another code would simply replace the first code.

I would like to be able to scan multiple codes, which then list into the email body. Also I would like to be able to add a quantity or comment to each scanned item. Basically something like a supermarket register. For example the body of the email should look something like this after I scanned 3 items and added their quantities:

scannedcode1 5
scannedcode2 2
scannedcode3 1

Can someone help me out here?

Preston To
Posts: 0
Joined: Thu Jun 18, 2015 12:35 pm

List scanned items

Anybody?

Jack Bua
Posts: 0
Joined: Sun Jun 28, 2015 10:16 pm

List scanned items

I have not yet gotten too deep into arrays, but this definitely sounds like when you would use one. I would look into arrays and append.

Preston To
Posts: 0
Joined: Thu Jun 18, 2015 12:35 pm

List scanned items

Basically all I need is to add the scanned code and it's quantity to the already existing data in the text box (preferably into a new line), instead of replacing it.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

List scanned items

Hello,

You can add data to the already existing data in the text box with JS on the success event:
preApperyio("labelName").text(Apperyio("labelName").text() + data.text);/pre
here labelName - name of the label

Preston To
Posts: 0
Joined: Thu Jun 18, 2015 12:35 pm

List scanned items

Hi Sergiy,

So what I have built is a "add to total" button which should copy the scanned/entered data (code, username and quantity, in form of text boxes) into the email body. However, I haven't gotten the code to work yet:

Apperyio("total").text(Apperyio("total").text() + username_copy.text + code_area.text + qty_area.text);

what am I missing?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

List scanned items

Please check are there any errors in console? This (http://devcenter.appery.io/documentat...) should help.

What values do variables (username_copy, code_area.text, qty_area.text) have?

Preston To
Posts: 0
Joined: Thu Jun 18, 2015 12:35 pm

List scanned items

Those 3 variables carry the username (copied from the login page), article code (output from the barcode scanner) and a text box for the user to enter a quantity.

Now I created a new label which should kind of work as a register. I scan a product, enter a quantity and click a button which combines the values from those 3 text boxes to the label (total). And the user should be able to add multiple articles before sending out their order.

Preston To
Posts: 0
Joined: Thu Jun 18, 2015 12:35 pm

List scanned items

found the problem. For text boxes, I needed to use .val to retreive their content. For labels I need to use .text

Return to “Issues”