When creating a new record, create a new collection with that records name

I’m looking for some help. I’ve tried looking for an answer but I don’t think I’m wording it right.

As I wrote in the headline, When creating a new record, I want to automatically create a new collection with that records name. I have tried adding a new action just after creating the record, I don’t see the Magic Text option when naming the new collection.

Basically I have a collection that is and overview of collections, and I want to be able to add and delete the subcollection through the “overview collection”

I’m thinking that my approach is wrong and that there is a different way of doing the “collection overview”.

Hi @Jvha,

Welcome to the forum!

Unfortunately, it’s not possible to create collections from within the app - it could be done only from the app builder.

But I wonder why would you want to have such functionality. “Collections” in Adalo is very similar to Database Tables in “classic” full code solutions; and it is a very rare case that one would like to create a new Table each time the record in some other table is added.

May be if you explain your goad someone could advice a better way to achieve it.

Best regards, Victor.

Hey Victor,

Thanks for the feedback.

Im trying out Adalo for my company, and to do that I’m just making a shoppinglist app that I can test out with my family. I want to be able to have lists for different shops, and the ability for user to add/delete lists.

My thought was to have a list of shops, and then link from that list to separate lists for each shop. Does this make sense?

Hi @Jvha,

Thanks for explaining your idea. For this you don’t really need to create a separate collection for each shop; in relational databases (Adalo collections basically represent this approach) it is done in a bit different way.

What I could suggest reg. the DB structure:

  1. Shops collection, with the fields
  • Shop name (text)
  • Shop details (text)
  • more to come (see below).
  1. Lists collection, with the fields:
  • List name (text)
  • Relationship to Users collection: 1:many, meaning that 1 user can have many lists, but each list belongs only to 1 user. Reciprocal field in Users will be created automatically.
  • Relationship to Shops collection: 1:many, meaning that 1 shop can have many lists, but each list belongs only to 1 shop. Reciprocal field in Shops will be created automatically.
  • more to come (see below)
  1. Items collection:
  • Item Name (text)
  • Item Description, price, … (what you need)
  • Relationship to Lists collection: 1:many, meaning that one List can have many items, but each Item belong only to 1 list. Reciprocal field in Lists will be created automatically.
  • NB: it’s possible to have other optional relationships for Items (to Users, for example), but it’s not necessary at the beginning.

After this, you might need to pre-populate the Shops collection with some entries.

With this structure, you’ll get the following:

  • User can create a List, which will uniquely belong to a User and a Shop. So one user can have several lists for several shops.
  • In turn, there could be several lists for each shop (belonging to different users)
  • After creating a list, User can start adding the Items to this list.

I highly recommend to read documentation at https://help.adalo.com, especially the “Lists” section, so that you understand the principles off DB and app design better.

Hope this helps.

Best regards, Victor.

1 Like

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