find specific items in multiple list stored in tinydb

52 views
Skip to first unread message

ced285

unread,
Jul 28, 2018, 10:31:54 AM7/28/18
to MIT App Inventor Forum

Hello everyone, I have a quick question regarding lists stored in a tiny db. I have a tinydb called (tinydb_TEAM) registered with various information

I want to create a procedure to check that item 2 of each list (tbox_creation_nom_equipe) does not exist before validating a form.


Here is the structure of my lists:


For example, here the items GREEN, RED. If I create a new RED team, I prevent validation. (no problem to do it) More generally: how to tell App Inventor to compare or retrieve only "item 2"of each list stored in the Tinydb_TEAM. I hope I'm not too confused in my example, thank you Ced

TimAI2

unread,
Jul 28, 2018, 11:00:39 AM7/28/18
to MIT App Inventor Forum
Does this help, a small aia that,using your tinydb structure, identifies the item 2 value...



Not your complete solution, but enough to get going with ?


aia attached



finditem2.aia

ced285

unread,
Jul 29, 2018, 5:59:12 AM7/29/18
to MIT App Inventor Forum
Thank you Tim for your answer and your file!

Despite your example, I have a hard time making this project a reality.

To resume your example, we imagine a txtbox and a button check.

If the contents of the txtbox = in item 2 of one of the saved lists then the result is true, otherwise false ...

In fact, I can not say to app inventor:

For each list stored in tinydb, see if each item number 2 equals the value of the textbox (for example color). If yes, then true, otherwise false.

The select list item method, will only compare the list 2. I would like to compare all the numbers 2 of all the lists.

I do not know if this is possible?

Thank you for the time,
Ced

Abraham Getzler

unread,
Jul 29, 2018, 12:37:56 PM7/29/18
to MIT App Inventor Forum
See this doc and sample app for filtering through value procedures.

ABG

shadowruge

unread,
Jul 29, 2018, 9:35:42 PM7/29/18
to MIT App Inventor Forum
bom acho que vc tera que criar uma lista de validação

novo item  lsta de validação(= ou diferent)       itens.validis
List.new =>       List.validasion =>                   List.valid

ced285

unread,
Jul 30, 2018, 4:44:22 PM7/30/18
to mitappinv...@googlegroups.com
I come back to you about the problem mentioned. Thanks to ABG, I could enrich my application of this procedure.

I share you the code and the .aia file so that it benefits everyone!

Thnaks for your responsiveness, TimAI2, ABG, shadowruge.

Ced
procedure_filter_list.png
finditem2_ced.aia
Reply all
Reply to author
Forward
0 new messages