No puedo guardar elementos en un visor de lista

hola amigos, he creado un escanner de códigos Qr con base de datos en Google Sheets, el problema que tengo es que no consigo guardar los item en un visor de lista.
Pd me gustaria hacer una lista de los productos que valla guardando en la tinyDB sin cambiar mi hoga de google sheets, no prentendo enviar informacion a mi hoja solo guardar en la tinyDB y mostrar en el visor

Hello,

can you share your relevant blocks? and explain in detail which is the problem you have?

Se quiere que la aplicacion escanee un codigo Qr que muestre su descripción, precio e imagen (esto lo hace perfectamente) en donde tengo el problema es en agregarlos en una lista, por los momentos solo agrega un item porque cuando escaneo uno nuevo e intento agregarlo reemplaza al item anterior.

traductor google:
I want the application to scan a QR code that shows its description, price and image (it does this perfectly) where I have the problem is adding them to a list, at the moment it only adds one item because when I scan a new one and try to add it it replaces to the previous item.

Can you shsre your blocks? (there is an automatic translation so you don't need to translate your text...además, en mi caso, te entiendo perfectamente).

you are overwriting LISTA. You read it from tinyDB in Initialize block, but when you are receiving the data from Web component you overwrite it. Use "add item" (list block) to add the new data received in the already existing list and then, store it again.

(btw, the "tinyDB" tag is not a good idea...change the name)

I assume the normal flow of your code is:

  • You read the data stored in TinyDB (when initializing)
  • Scans
  • GoogleSheet queries
  • You receive data from google sheet
  • You add them to the list that you had read from tinyDB (here you should show the new list in your ListView)
  • You save the list (with the new element) in tinyDB

Intentare hacer lo que me indicas. gracias de antemano.

Si, esto es lo que debería hacer la aplicación.


he agregado al boton "AGREGAR" el bloque "añadir elemento a la lista" pero sigo con el mismo problema

But, you get the new element after you call to the googleSheet, right? then you have to add to the list the new element you are receiving in GotText block.

Then, when click on "Agregar" you can store the list in tinyDB (the list where the new element has been added)

Amigo pude resolver el problema, gracias por tus consejos

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.