Can you add Collection Properties from inside your App?

I was wondering if it would be possible to create new properties inside of an existing collection from within your app? For instance, If I had a Collection of products and each of those products initially had three image fields and someone wanted to add an additional image, could there be a button that would allow the user to add a new Image Property from within the app so they could upload an additional image (or 10 for that matter) into the existing collection?

Another example would be if I were to build a recipe app and have a whole host of fields to contain the recipe ingredients and a bunch for the steps involved. Then a user runs into an issue where they have a very complex recipe and there isn’t enough fields to enter in all of the ingredients, could they click a button to create a new Text property for the additional ingredient(s)?

Kind of on the same topic, is there a way within a form to have some fields only be visible when certain fields are filled out? Using my recipe example, If I had 20 text properties in a collection just for ingredients, I wouldn’t want my user to have to scroll past all of the extra inputs if they only had a few ingredients in their recipe. The only workaround for this I have found is to initially create the recipe with a basic item or two, such as Recipe Name then send them to a new page where they can update the collection items. This allows me to program in a function where someone can click on a button that ups the count of a # of ingredients property by one so I can use the visibility feature on all of the extra fields based on the “hidden” ingredient count.

I’m really just trying to reduce the number of initial fields in a collection because it seems like it can get out of hand fairly quickly when you have multiple fields that are needed for a single item (measurement, qty, ingredient name, etc).

I’m guessing it wont be possible to do what I want mainly because the database wouldn’t really know what to do with the information or even what order it would go into the list view.

Thanks for any help or insight you can provide!

It is not possible to change the data model at run time within the app.

As for the 2 cases that you mentioned, an in this very situation of a user needing to Add ingredients…
I think that you just need to change the way you are trying to “layout your needs”.
that is : … place ingd not in line…but in columns :wink:

under your collection of user add 2 more collections:

  • A for “Recipe Title”
  • B for “ingredients”
    add the collection A to User and Collection B to R.T
    Now a user will be able to add as many ingredients to its Recipe plus you will have actually reduced the number of Fields to the strict minimum.
    you may want to add an “Ingredient QTY” number to A… so as to display only the first X ingd.
    If a user wants to add more, he ll ask you, then you can change the number to a higher value for the list to display more stuff in that case.

(not sure is the filter can easily be modified to use that criteria - but this is the global idea) :grimacing: :grimacing: :grimacing:

That’s what I figured. Thanks for the response.

I thought about doing what you said and wasn’t sure how to build out the relationships. I also am not sure how to allow the user to create different sections to a recipe: For instance, if someone was entering in the information on how to build a dessert, they might have a set of ingredients and instructions for a crust, another set of ingredients and instructions for the filling, and perhaps a set of ingredients and instructions for a sauce. On the other hand, another user may only have one set of ingredients and instructions.

thats fine, I guess you need to become familiar to how Database (collections) and relations need to be set. This is a bit different than using an excell sheet.
recommanding :wink:https://www.youtube.com/watch?v=wR0jg0eQsZA

and wrap your head on adalo is going to achieve all necessary step using the How To :wink:


and dont be afraid to test and install or tweak the samples so you can understand what you re doing.
:grin:
1 Like

As mentioned already, the solution to this problem lies in the database design itself.

Your collections could be setup something like this:

  1. Users
  2. Recipes
  • Title (text)
  • Description (text)
  • Ingredients (Relationship to Ingredients collection)
  • Added by (Relationship to user’s collection) (This will be the user who added the recipe)
  1. Ingredients
  • Name (text)
  • Volume (number) (this will tie in with the metric)
  • Metric (text) (Liters, kilograms etc)
  • Recipes (This will be created automatically when you created it within the recipes collection)

This is just a basic design from the top of my head. Watching the tutorial video posted above will give you further insight in how you might need to adapt this.

Let us know how you get on!

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