Need help for adding in list

Hi,

I would like to have your help to understand and help me correct. My application for storing passwords, I add my information in a dictionary with TinyDB, then I display all the elements in a list.

The first one is fine. The second one is fine. But in the 3rd, I have an empty element added.

Then, when I want to edit an element, to try, and put the same title as an already existing element, it gets deleted.

What I would like is to be able to store elements without ever having a duplicate, so I store with the title key. And if we ever try to add an element that already exists, we would need a notification to warn and do nothing.

I am attaching the .aia, if you can help me, that would be really nice, thank you!
PassManager.aia (149.5 KB)

just a small tip: switch the language to English before posting a screenshot, you might get more answers then… also expand all blocks…

Taifun

Ah yes indeed, thanks for the advice! But when I share the aia, it stays in the language I exported to?

Well, soneone who likes to open your project can switch the language to English then… however I will not do this…

If you are asking for help, I recommend you to make it as easy for others to be able to help you …

You probably will get more feedback then…

which means in your case post a screenshot of your relevant blocks…

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc… this takes time, and most people will not do that…

Thank you.

Taifun

Alright, thanks for the advice @Taifun

So here is the block, I think that is causing the problem, in English :

And I am also attaching the aia project switched to English too :
PassManager.aia (149.5 KB)

The problem is that at times, I have an empty line added.
Also problems when I want to edit an element by giving it a name that already exists. I want each item in the list to be unique by title.

Thank you for your help

Sorry, can you help me please ? :frowning:

This should be InputTitle


Taifun

Thank you, a small error but which has no impact on the problem I mentioned.

I made the correction, but I still have an empty item which is created when adding the 3rd item

Clear TinyDB and restart testing
And if you still get an error, post a screenshot of the relevant blocks including Do it result, so we can understand, what you are talking about

Taifun

It’s hard me to understand the logic behind this button click event. Can you explain step by step? Sometimes, explaining like this unveils logical bugs when read out aloud (rubber duck programming :baby_chick:)

1 Like

Thanks for your answer, I will try to be as clear as possible in my explanations, despite the use of Google translate.

I have a button that opens the Modal with 3 inputs: the title, subtitle and password.
A button to validate and add the password to a dictionary and tinydb

If I add a first element, everything is fine. If I add a second element, everything is fine. If I add a 3rd element, it is added well but a 4th empty element is added at the same time.

You can take the aia that I provided before because I still have not solved this problem and therefore it is still at the same stage.

1 Like

You can test my aia :

PassManager.aia (149.6 KB)