How to edit or add data to a previous item in a list view?

I need help. I want to create a phone book that data can be added to. Ie: I use the listview to be able to manually insert:
“Address” “Number”.
And then, when all the addresses are inserted, to be able to select one and add other data to it, edit it; without modifying the address and number. Example:
“Address” “Number” “Note”
Try a second listview for “Notes”, however, that means all notes will appear together, regardless of the address you select. I want each address and number to have its own Note. So when you select one, please have their respective information. Example:
“Note: I called on Friday”
I repeat, the Notes information must be inserted after I have my address and number. I am editing and adding one more piece of information to the information.

1 Like

In Relational database you would have:
the table with the numbers, addresses and contact id.
1 Jonh 7899-8996
2 Carl 6779-4309
3 Mary 8807-2134

And the second table would have the annotation id, annotation, annotation date and the contact id.

1 07/12/2020 “Congratulations” 3
2 08/08/2020 “How até You ?” 1
3 08/08/2020. “Call me” 3

Carl id 2, has no notes.

Thus, when selecting the contact, you will only show the annotations for the id of that chosen contact.

Thank you! Sorry, I’m new, I’m confused. Where do you get the relational database? And how do I generate an ID for each contact?

1 Like

Relational data base, it can be MySQL.
In Relational databases, these ids are generated by a type of field: (AUTOINCREMENT)

1 Like

You can learn in:

Hello again, thanks for the information; but I really don’t get it.
So far in my application I have managed to insert the contacts effectively with the list view.

Mainly the “Address” appears. Selecting one makes a vertical layout called “Information” visible, where contact information (address and number) is displayed.

And underneath you have list view 2 (for the notes), and then a button called Edit. Clicking the button takes you to another vertical arrangement called “Add”, where you have the Notes text field.

There I can enter the information that I want to link to list view 2. And then the Save button. When saving, my notes are effectively displayed in the “Information” vertical.

That is, it shows:
“Address” (List view 1)
“Number” (List View 1)
“Note” (list view 2)

The problem is that when I do the same with another contact, the notes accumulate and look like a list, and they all appear in any contact.

Would there be a way to automatically assign each note an ID related to each contact? Or show your notes with something other than a list view, so they don’t pile up and show all at once. I read that dynamic components could help, but I still don’t understand much.

Sorry for the inconvenience.

Did you try to clear the list before showing it?

Hmm, what do you mean? If I delete the list, wouldn’t all the notes be deleted as well? then none would be saved, right? The idea of ​​the notes is to function as a reminder or warning. For when a contact is selected and the information is displayed, in addition to the number, it shows additional information entered later. “Yes I call”, “I call at 4, Friday”, etc.

Friend , lists are in your smartphone’s memory. They are the ones receiving values ​​from your Firebase and are accumulating data.
Firebase <> Your Variable List
are diferents…