TINYDB1.get tags display tags from tindydb1 and other tinydb's too .. why is it?

643 views
Skip to first unread message

omkar

unread,
Nov 17, 2015, 8:21:45 AM11/17/15
to MIT App Inventor Forum

i have a list of students names in a tinydb1 with tag as their student_id and value as their name .. and other tinydb2 has same information of teachers.. when i want to display all 
the student id's i used tinydb1.gettags and it shows even the teacher's tags in it .. plz help

SteveJG

unread,
Nov 17, 2015, 9:23:55 AM11/17/15
to MIT App Inventor Forum
App Inventor 2 has only one TinyDB  database.   Users do have to provide an instance of the DB on each screen they use the data with.  When you name a database tinydb2 , it uses the same tags as tinydb1 .
That is your problem.   How about saving the students  to   a   tag   of    students      and  the teachers   to a tag of  teachers?

Let us know what happens, keeping them separate using different tags should allow you to displays only the tinydb1     tags you want.

Gettags returns a list of ALL the tags in the data store.   You have to use the  GetValue block and store all the tags as a List instead of storing the studentNames as individual tags.    Store as a List, then cycle through the retrieved list to display them perhaps.

Regards,
Steve

omkar

unread,
Nov 17, 2015, 9:47:00 AM11/17/15
to MIT App Inventor Forum
when i use a list for all the  tags from two tinydb's ..i can " remove item from list using index " to remove all tags of second tinydb(which i dont want ) .. but how would i know the 
index ?

SteveJG

unread,
Nov 17, 2015, 9:55:48 AM11/17/15
to MIT App Inventor Forum
Here are some resources omkar .     You  do not have a second database, you have only a single database, that is why the  tinydb1.gettags  block provides you ALL the tags...they are all stored on TinyDB.
We do not know what your data 'looks like' and have not seen your blocks so the best advice for the moment is here:

=====
Lists
Sajal's example    http://www.imagnity.com/tutorials/app-inventor/list-blocks-on-app-inventor/     shows how to search a List and more




List of Lists

========================
TinyDB



========================

omkar

unread,
Nov 17, 2015, 9:57:35 AM11/17/15
to MIT App Inventor Forum
thank you SteveJG
Reply all
Reply to author
Forward
0 new messages