Can a list have multiple copies of the same entry?

Create a new table that has the multiplier and the material ?

So instead of Onions, Onions … you have 2 x Onions (sorry for the oversimilfication !_)

Bubble doesn’t have arrays.

So what I’ve done in similar circumstances is create an “array” table in the database. Like this:

Thing 1

  • field
  • field
  • field

Thing 1 array

  • Thing 1
  • amount

So if you wanted a list of Thing 1’s with multiples you’d create new Thing 1 arrays and put the multiples in the “amount” field. Then save the list of Thing 1 arrays.

This means when you try to search you’ll have a harder time because the data is split across multiple tables. The search function will only let you search by the fields on the thing you’re searching for. I’ve actually duplicated a lot of data. I just record it in a couple different places when it changes so that I can look it up either by array or by the duplicate field on another table. You can also use a trick where you set a search field to something like “[field-whatever] [is in/isn’t in] [search for thing-1-array]”. The nested search happens first and its results act as a filter for the parent search.

I tried to get around it (and excuse me im a newb) by doing the following

Created a new entry in the TASK database called MATERIALS

to put it in perspective
TASK
Name = bake a loaf of bread
Materials = MATERIALS

MATERIALS
material 1 = dough
material 2 = flour

the list of TASK-MATERIALS is now displayed on my page as a repeating group with a little X icon to delete the MATERIAL and a + and - to add and subtract more or less of the item.

I now have the problem (an im a newb at databases so i’m sure you’ll chuckle) but when I delete the material in TASK it deletes the material from TASK-MATERIAL but also deletes the main copy of the material in MATERIALS

any advice

**edit - which is not what I want, I want to keep the database of materials secure

If you delete a record Bubble will also remove it from any lists it’s in.

You’re probably deleting the record itself instead of removing it from the list.

To remove something from a list use the “make changes to a thing” action. Select the field with the list and make changes to that field.

so again a silly question.
Is the MATERIALS entry in TASK-MATERIALS it’s own entry or just a link.

In perspective
if I have multiple tasks say
TASKS
name: BAKING BREAD
materials: MATERIALS

name: COOKING COOKIES
materials: MATERIALS

MATERIALS
name: DOUGH
amount: 500

name: FLOUR
amount: 300

and both
BAKING BREAD-MATERIALS contains dough
COOKING COOKIES contains dough

if I change the amount in BAKING BREAD-MATERIALS will it affect COOKING COOKING-MATERIALS

the same as when I deleted the item it deleted it from the main database

BTW thanks champion for the remove tip it worked perfectly

OK dont worry found the answer :frowning:
They’re linked rather than a copy.

Is there a way I can copy MATERIALS-DOUGH from the database MATERIALS into the TASK-MATERIALS easily?

edit* and if I did this would I have trouble getting metrics in future. say when I try to produce a graph for how much dough I used in each month of the year?

You don’t want to make a copy of the Material record because then if you change the original Material record the copy will still be old. For example, if you edit the record to fix a spelling mistake (change “hamer” to hammer" or whatever).

Also, if you want to get metrics later, then you want a bunch of references to the same thing. That way they’re easy to count. If you have independent copies, none of them linked to each other, then all you can do is count words (like count how many things have the word “hammer” in them, and how many things have “hamer”, and add them together).

what would you recommend

I’m not sure. Your descriptions of the database aren’t clear enough for me to fully understand it. If you can post a link to your editor we can look around.

I do know that if you’re trying to build nested hierarchies of tables I don’t think it’s going to work. I tried to do that a while ago and I couldn’t get the math to work because Bubble doesn’t do loops/repeats/recursion in real time. For example, a Meal with a list of Ingredients, with a list of Nutrients makes sense in most other languages where you can build and search nested arrays. But in Bubble you get stuck at the first level because you can’t iterate over the list.

do i just post a link to my app?

to the above comment… bugger. I think thats what im trying to do.

copy the URL when you’re in the editor and paste it into the forum

youll need to type in bread in the top search bar and wait for the baking bread to come up then the repeating lists will appear

basically there will be a customer (not done yet), and under the customer there will be different tasks to be done, bake a loaf of bread, cook some cookies etc, then each task will have ingredients dough, flour etc etc

That’s the URL from your app in run mode. Copy the URL from the editor, where you build the app and make changes.

That’s taking me back to my dashboard. You might have to allow viewing under the app’s settings.

try now

Still not working for me. Look for this dropdown under settings > general
image

The link is pasting with “&” instead of just “&”

Just remove the “amp;” and should work