Find Item in a List

Hello! I am building a Cookbook. Using TinyDB i save the Name of the recipes, Category, Ingredients, ecc. I wuold like to know, if it is possible, how to set ListPick, were will appear only the names of the category (in this case the index number is 3) like First Dishes (Carbonara, Lasagne, ecc), Second Dishes, ecc, already inserted previously in the recipe list.
Thank You

You can build up tags for TinyDB like /Category/RecipeName, for example /APPETIZERS/Spring Rolls.
Use filter procedures to select tags that match the desired category.

This sample app uses that technique to select teams from a scorekeeping data base …


lpkTeam_BeforePicking addPlus allPlayers allTeams
All blocks are draggable.

Tahnk You very much ABG!
It’s a great job, and I learned to use the / tag / tags (I’ve only been using MitAppInv2 for a month), but I’d like that as soon as you open the screen, in the listpick, the various categories appear, and then, once selected a category, the list of courses appears. Thanks so much. Carlo

Before going into details, I have to ask about where the recipes are coming from.

Were you planning on supplying the recipes already built into the app as files, or
were you planning on having the app user enter his own categories and recipes, just for himself?

That decision changes the app architecture, so it has to be made early.

Well! Let me introduce myself, I am Carlo and I have been a chef in the kitchen for more than 30 years, as well as the owner of a hotel, and the recipes are mine. What I want to do is create an app where you can add and read recipes. I have already created an Excel sheet with all my recipes.
I transferred this file to Google Sheets for convenience and then uploaded the recipes to TinyDb.
Now, I load the recipes in a “ListView” from Google Sheets, select the recipe with the ingredients, etc. and then pass everything to the various Labels then save the data in TinyDB with the TAG “Recipe name” and all the rest that is stored in “Local Temp” (Ingredients, Weight, Author, etc.).
So far everything OK! But when I read the data from TinyDB, it gets complicated: it only inserts the data of the first TAG of the recipes after selecting it from the “ListView” (for example: if I have Lasagna, Spaghetti, Roast-Beef, even if I select Roast-Beef I will always Lasagne.
I am attaching an image of the final result. Certainly I’m wrong some passages.
Thanks again, Carlo

1 Like

PS: no, I didn’t think of publishing the recipes, maybe some just to understand how the APP works.

Now that I know more about your app, I can present some more ways of doing it, through files in your Media folder if you want to work offline too, and by filtering tables through selection of attributes.

Here is a collection of table filtering techniques, since you already have your recipes in a table …

Here is an example of how to keep the branches of a tree in a table, and how to traverse it, if you want a flexible data structure with arbitrary depth …

Here is an example of complex data stored in JSON format in files in the Media folder, for cases where the data won’t fit into a rows and columns spreadsheet…

(edit) I forgot a little app I did for drink recipes, where I solved the wrong problem.
It’s at https://groups.google.com/d/msg/mitappinventortest/656oDTQeomU/7-WNXaxBGwAJ

Warning - beware of storing images in your app. They can fill up your app beyond the 10MB size limit of the AI2 server, unless you cut them down to fewer pixels.

I caught a quick peek at your code, and I have to recommend a recent tutorial on how to deal with not found lookups ...

Hi ABG!
Thank you so much for your help! I managed to solve this in this way:

Thank You very much.
When the app will be finished i provide to send you a copy :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.