How would you handle this scenario for a templated list?

So, this is more of a curiosity of methodology and thinking through practical application development. I have a scenario where I’d like to create a templated list. I’ll give you more of a real world practical example below. I’m just curious if anyone has done something similar and maybe if there are better methods for handling such a scenario.

Here’s an example of what I’m trying to achieve I’m just not sure how easy it will be.

I’d like to create a templated list. Think of it like a packing list. So a user enters their new trip and then they decide I need a starter to-do list or packing list that has all the things I should think of before packing. This list might include shoes, socks, pants, shirts, toothbrush, etc. They could attach this list to their trip and then check off items as they go. However, lets say they didn’t have a need for some of the items or they had other items that they wanted to make sure they included. I’d like them to be able to save this new defined list as their own template they could reference for future trips.

The logic or really the relational table buildout is what’s tripping me up. Any thoughts or even examples of something similar would be great.

1 Like

Hi @ctown :wave:

Love db design questions because they also trip me up a lot so there’s a high chance my solution is not the best :sweat_smile:

The “simple” solution, but probably not the best db design-wise, would be to have a trip table with a “checklist” column where the checklist was a default json that can be updated based on the tasks the user deletes, checks off or adds. That could be a satisfying solution if you know for sure the checklist is not going to get overly complex over time (otherwise editing the json will become messy).

The more scalable solution might be to have trip and task tables. Every time a trip is created, default tasks are also created and linked to the trip. Then the user can delete, add, edit task records. That will give you more flexibility to make tasks more complex in the future. It also simplifies the visualization and edition of individual tasks.

Hope that helps!

Not sure what your experience is with database design but, if you’re fairly new to this, you might find these two videos helpful: