Edit and update data in a listview and TinyDB

Greetings forum members, I have managed to have an app for a database of Reference, name and Address. For this I use a listview and save to a TinyDB. I need to be able to Edit and update the information that is on screen 2. Please I would like you to help me in the block that I upload so that you can see it. I thank you in advance and support.

Simulating with data I get this error


Your logic is very strange. It looks like you are trying to replace an item in a list that does not exist, or if it does, will be replaced by the same item?

Also (even though the blocks are wrong) should TbxNombre.Text be TbxReferencia.Text ?

Do you not know where ( which index) these items are already stored ? perhaps you should record their indexes in variables when you first and subsequently save them in order for you to be able to find them again later.

1 Like

Thanks for answering my topic

indeed, yes, it was my mistake, it should be TbxReference

I have another block to store the data and it works fine

The list exists well, I save with a block that works ... and yes, I want to be able to edit what I have selected in a listview and that I get it in three textboxes, in that textbox I write the correct thing and then I want it to be corrected

Greetings again, this block does edit but only corrects the first record of the 3 data. The second and the others are not modified.

This is better.

Without seeing the data it is difficult to understand why lists Nombre and Dir are not being updated?

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools

Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thanks TIMAI2 here I upload an example file .aia ..
I still do not know how to upload .aia files in MIT and be placed directly in your MIT
Thanks in advance

DB_EDIT_en_Tiny_ListView_V1.aia (8.5 KB)

Thanks I will review

Sorry I reference your files,but I found a little problem .
When I add the data and switch to the Scr_VerList.
After if I want add a new data, and the new data will cover the old data.
I don't what happen, can you help me to fix these problem