Forum Academy Marketplace Showcase Pricing Features

Adding a bunch of things to a thing. To list or not to list?

I’m having a hard time working out what my database structure and workflow should be to achieve what I am trying. Hoping somebody smarter than me can point me in the right direction.

In my app a user can create a list of different Tasks, which are standard for their account.

Then, they can create new Events. Each Event should have all of the Tasks associated with it, so that for each Event you can mark off each Task, and not who completed the Task on what date.

I have a Table with Events and a table with Tasks. I’m not sure what to do to get the two associated. My first thought was to have another table, like Event_Tasks, where Tasks and Events are associated and then I can add date completed and who did so. I’m not sure how I would generate each Task/Event combo though. Via an API?

Or is there a better way?

Hi major_groove (Nice name)

Have a look at this youtube playlist I created that explains it quite well with orders and items instead of tasks and events. Especially video 4 although I recommend watching all videos to gain a better understanding of bubble.

If you are real quick, the two sentence summary is: Within events create a new field “list of tasks”. Whenever you create a task, in step 2, add that task to the events list of tasks using “Make changes to thing” “parent groups event” : list of tasks: add: result of step 1 (the task creation)

1 Like

Hi TipLister!

Thanks for the tips and the videos. I watched them all and they do help.

Question following your video - how would I make changes to an item, that is only associated with that Order? i.e. in your demo if I change the price of a Banana, then that Banana’s price is changed throughout the app.

What if I want to record the date that that banana was purchased? That can’t go against the banana item itself, as that is universal to the banana. Can it somehow go in the Orders table, if banana is represented only as items in a list?

I can’t see where that data would go. Would you make another table where you store this like Orders_Items_Purchase where you link the two tables together with the extra information like Order-Item-Purchasedate?

Also - your demo works well for adding one Item at a time. What if I want to add all the Items at the same time to an Order? i.e. in my app, every time an Event is created, it should be default already have every available default Task added to it. When each Task is completed, and by whom, is then unique to that Event.

N.B. My username origins story. :wink:

Hi.

Here are your 3 videos.

  1. So from the video you would use order items created date. (Instead of items created date). Or Shopping Orders created date, for the whole list of items you ordered. The latter may be useful if you want to send reminder emails for people to complete their purchase of a list of things.

  2. Use api workflows. In mine I added a shopping order to the user upon signup. You can add an event to the user. If you want the tasks to be user created then go for video 3.

ah major groove. I knew of them, studied pharmacy. : )

1 Like

I just wanted to follow-up here to thank @TipLister and report that I finally managed to get this to work.

At first I could not do it. My app had got too complicated and I kept on adding tables and data types and digging myself deeper and deeper into a hole. It got depressing so I stopped working on the app for a couple of months.

Then I spoke to a friend who is a database whizz, who gave me some pointers, and I tried again. This time, I decided to just start the app again from scratch (which meant stopping a subscription and starting a new one!) to avoid the confusion with the data types. After watching Tiplister’s videos maybe 15-20 times each (not an exaggeration), I finally got it to work - I can add Tasks automatically to a list using the API when I create a new Event.

I had never done anything with any kind of API before so it was a real challenge for me. I am very happy to finally get it done.

One thing - I find it odd how slow the API is - when I create a new Event, I can literally see the Tasks get added to a list approx every 0.5s - I kinda imagined it would be instantaneous. It takes maye 3-4s for 5 Events to get added - at least in the Repeating Group that I can see. Is that expected?

thank you major_groove. Glad I could help.

Yes, it takes 0.5 seconds for me too:
When I click create/submit, the step before I run the API workflow, I set a state of an icon from no to yes (and set it from yes to no after the workflow, in the last step).

That icon is a loading icon (search for “spinning”) in the icons. That icon I only show if the state is yes. I make that spinning icon rotate too.

That helps the user know what is happening.

1 Like