Page 1 of 1

List scanned items

Posted: Thu Nov 05, 2015 9:36 am
by Preston To

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?


List scanned items

Posted: Mon Nov 09, 2015 6:37 am
by Preston To

Anybody?


List scanned items

Posted: Mon Nov 09, 2015 7:14 am
by Jack Bua

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.


List scanned items

Posted: Mon Nov 09, 2015 9:21 am
by Preston To

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.


List scanned items

Posted: Mon Nov 09, 2015 10:02 am
by Serhii Kulibaba

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


List scanned items

Posted: Mon Nov 09, 2015 12:00 pm
by Preston To

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?


List scanned items

Posted: Tue Nov 10, 2015 12:06 pm
by Serhii Kulibaba

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?


List scanned items

Posted: Thu Nov 12, 2015 7:19 am
by Preston To

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.


List scanned items

Posted: Thu Nov 12, 2015 11:57 am
by Preston To

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