I want to store multiple values (as a list) in a tag (say ‘categories’). At some point I would also want to get values from tinydb & check if the tag ‘categories’ contains a value called ‘x’. Since the values are stored in a list (‘x’ is one of the values in the list) I’m a bit confused. Could you people help me with it ?
It would be greatly appreciated if you could show me the blocks.
@PRATY_PROGRAMME_S_LABS A lot of numbers to be stored. Any other way without the index thing ? I just wanna check if the list has a certain number. So I hope index is not important. Can this be done with a ‘for each do’ loop ?
Call the list back from the tinydb to a variable and use the “is in list” block to check if an item is in the list
@TimAi2
This what I tried & is wrong. Could you help me correct this ?
when I add a new value to the list the previously stored one gets deleted.
what this one has to do with my question ?
No sign of the “is in list” block ???
My question was regarding lists & tinydb. I just don’t understand what you’re trying to say.
where shall I put it ? if you dont mind can you show it with blocks ?
Like so:
The main problem is when I add new values (via variables) to the list the previous values gets deleted. Like if the list previously had a value ‘1’ then if I add a new value ‘2’ then ‘1’ will get deleted or removed.
Add the new values to a list, then save the list to the tinydb with a tag
to retrieve the list and set to a variable:
did you check my screenshots above ? this is what I did na ?
sharing them again:
How is global TinyDB_List
variable initialised?
You need to set your global TinyDB_List
variable to the list stored in TinyDB before adding items to list. Something like this
Above is just an example. You have to set it according to your need
Not working. I tried it beofre, But it was placed below ‘call TinyDB1 store value’. Not working this time too.
For me its working exactly as it should work. Can you post a sample aia here illustrating the problem?
there are like 1700+ blocks