New Order - App inventor

Please I would like some help with making lists. I would like to place an order and automatically create a code for that particular order

See http://www.appinventor.org/bookChapters/chapter19.pdf
in the free online book at
FAQ Section: Books, Tips, Tutorials for AI2

After you have learned how to use lists, see

image

I tried this way but it's not working as I wanted. identifying the order with the number. In the case of the image, the screen displays code 1 for all orders I make.

Here is the image for better visualization of the implementation part.

Please download and post each of those event block(s)/procedures here ...
(sample video)

If you want to make unique order numbers that increase in time for new orders, why not use Clock1.SystemTime at the time the order is created for the TinyDB tag?

Keep the orders in a separate TinyDB NameSpace, so that when you ask for a TinyDB TagList from that NameSpace, you will get a sorted list of all your order tags and nothing leftover from other projects.

Because you will never accept new orders within the same millisecond, your order numbers will be unique.

Could you make an example block to perform an implementation with the above information?

Try to run what is in gif but I would like only the number and not the start and end date.

Export your .aia file and upload it here.
export_and_upload_aia

1 Like

FRETE2_0.aia (53.4 KB)

I managed to solve the problem to add the code in the order. However, I can't display it in the listview.

I wanted to display in ListView

Move the tinydb-index part to screen init, like this
image

so user can see what is the current order number