How to Remove Item To list and save the list into tinydb

Its not remove from tinydb when i refresh the page previous list come.

Please follow my post above.
From your error, the index is 0 which is not the case.

Same error comes

What is the index your are trying to remove? Your structure return zero which is not correct.
Either the tinyDB is already empty or the position block is wrong.
What does position block return?


My tinydb is not empty, I select First position to remove item from the list.

Use this method

In every remove list item list blocks index

And if you added space or anything with title then remove it while putting it at thing in index in the list thing

Then select 1 as the index directly.

How could you know if user selects 1 or 2 as position and if list Length increase to 100 or more is it correct to do so

No I don’t think it will work if you put position there

And also remember to put your remove item of list view at the last of all blocks

I have price and quantity, so how can i remove those things

In remove list item list block list will change but index will remain same as I showed

So how can i remove them… by using get title?

By using get title in index in the list thing you will get an index of that item in that list and that index is same for every list that means at same index you will get title, price, quantity and so on in their respective list’s

In your case, position is already the index. So just put get position in the index slot of remove list item.

The problem that you are doing that the list text and image returns postion starting from 0 not from 1…Means that if you select the first item the index will be 0!

What’s the solution?

Just make like this :
And do this in any block you are using the postion var in except the remove from list blok
blocks (48)

Learn more :

1 Like

No, the first item is not 0.
It is one.

Edit:

@Mohamed_Tamer is right.

(But this is true) The reason why he got 0 for index 0 is because the item doesn’t exist in the list (index in list), therefore it returns 0.

1 Like

See this @WatermelonIce

1 Like