Help with my code

Hello, anyone who can help e, the first pic is of my button there should save the textboxes in listview. The other is the edit button. But when i push the edit button its fills the textboxes in the right way, but when i will save, i should push two times on save button and it make 2 lines with the new filled in the listview. Can you help so i only push one time and it only make one line i listview.



Something is missing regarding how global reidigerIndex is updated.

Export and post the aia

(I am guessing what is happening from the data flow, while not understanding any of the words in the app.)

Im sorry, its in danish:)

Its under Screenviews

PrepperApp.aia (1.3 MB)

What do you notice if you move all those blocks away from the for each item from the list?

thats for resetting the textboxes to empty after safe.

I understand your query after reading multiple times. sorry. ok which button is act as a edit here? i am unable to find it also where do you set index value which is used in the replace item in the list?

Which button is the save button?

PrepperApp (1).aia (1.3 MB)

Found the reason. you set the global LargerVisning to empty list while adding the items to the list, but you failed to do in the replacement so it was doubled also throws wrong index. now i rearranged the logic slightly and found working.

Addition
Deletion
Edit

Pls check it

Now tinydb also function properly. In your earlier version the updated one didn't saved. but in this version the edited values will be saved. Pls remove the clock component. Accidentally i have added it

sorry here is the correct picture. The button Rediger is Edit button. In blocks it called btnRediger.

But the old line have to go so you only have "the same line" but edited, now is the old line and the new edited.

Sorry my mistake.

Pls clear all data from your tinydb and try. I have tested the code and shared with you

I see it, its my mistake. Where in the code can i put the notifier? Its tells the user to remember to fill all boxes before safe, if there is a box not filled.

Move the for each item block below the tinydb block and in the first if then condition add else (it is missing, not yet added) and try
PrepperApp.aia (1.3 MB)