Data structure, complex lists and how to use them?

Hi everyone, I’m trying to get my head around this data structure stuff!

I saw an example of complex lists by NigelG where he used 3 data types Recipebook, recipe and ingredients. Database Lists, How do I use a list?

Recipebook had a list of recipes, and each recipe had a list of ingredients. So far this all makes sense to me.

However what i find confusing is how to actually use these fields.
Here is an example link I’ve set up to get my head around this:

I have a few questions:

  1. So every recipe book contains a list of recipes which in turn contain a list of ingredients, right?
  2. Keeping to Nigels original example, lets say I want to search for all recipes containing mint, how would I do this?
    As my search bar will not let me search list fields?

Thanks a lot in advance!

I put together a basic search in your app that does what you are looking for. Hopefully it helps :slight_smile:

1 Like

That makes a lot of sense, thanks for that! So a problem I now have is that when I run a search for an ingredient that is contained within several recipes, it returns several duplicate search terms and shows only one recipe on the repeating group, how would I fix this?

e.g. when I search oil, it shows oil , oil (1) and oil (2), each only showing one recipe.

The weird thing is it works for mint but not for spice or oil. For mint my database only created one ingredient everytime I added it, but for oil and spice it made multiple items!

Sorry but I changed the permissions to only view as last time sometime deleted what i did!

My own thought right now is that I can only make the search bar not show repeats when the data thing it is searching only has ONE field type right, so ingredient would only have a name.

I added another field to ingredient called type (text) and then this problem arised? Am i right? Guess that’s a valuable lesson for using lists, whether they are complex or just normal bubble lists!

Sorry, but that’s kind of funny cause I went into your app and was like, there’s nothing here! lol

Anyway, you have a flaw in your workflow structure. You have your Recipe linked to an Ingredient Thing. However, you are using a text input to add ingredients to your recipes and creating a new Ingredient record every time. That’s why you are getting the (1), (2), (3) etc on the end of your ingredients because every time you add ‘Mint’, instead of linking the recipe to the existing Mint record, it’s creating an additional record.

Try using a Search Box with Dynamic Choice and define the list of options as type Ingredient. Exactly how the Search Box I set up further down the page is.

Then instead of creating a new Ingredient in your workflow, get rid of step 1 and keep the make changes to Recipe action. Only change it from ‘add result of step 1’ to ‘add Search Box’s value’.

That will start linking your ingredients instead of creating new ones.

You can use a text input and put conditions on your workflow so if that ingredient already exists it won’t create a new one, etc but I would get it working with a search box first and get into the more advanced things later.

Good luck!

If you look in your database, there are 4 mints I think :slight_smile:

haha yes I was pretty confused too!

I tried the way you are saying, not to create a new ingredient and to just make a change to the recipes list of ingredients. However, it is not working.Could I add that I would like every ingredient to have more than one data field such as name, type and price?


it doesn’t recognise that I want to add the name? haha ahhh I’m feeling the confusion

I am tired of looking at this example now so I will get back to my piece of work and will try see how it works on there! I want to avoid using workflows to avoid duplicates just yet as that would slow down the webpage as my page grows right?

I appreciate your help though! Thanks alot