List of text default values

How can I create a set of default values for a list of text field in a db table? I have a fitness app where I need every user to have set of “Heart Rate Training Zones” with default values as follows:

  • “Zone 1 100bpm”
  • “Zone 2 120bpm”
    … and so on, up to a total of 5 zones

I have this working and can allow my user’s to edit their specific training zone values. I use a “List of Text” in my “User” table to hold that user’s specific heart zone rates.

That is, user’s can change their training zones for their own needs. However, every user needs default values created for them initially. But, it seems you can’t set / create a list of text item’s default values. Is this correct?

I went a different route and tried to create a separate DB table “Training_zone_HR” with fields “Zone 1”, “Zone 2” etc as individual text fields. Which can have default values when you create a simple, singular text field for a DB table.

But, I couldn’t see a simple way to populate a dropdown with values from the 5 specific fields “Zone 1” , “Zone 2” etc etc… And it’s not proper database design to put an array of values into separate fields within a table. I only went this route bc it was the only way I could see to create default text values.

I must be missing something, is there no way to just create a simple, hard-coded default set of values for an array of text items?

Might help someone but what I did was create an Option Set with values for each default training zone (a total of 5 training zones). And, the only way to get those values into each user’s “training-zone” field in the “User” table is to create a Workflow that executes when a new user signs up.

So, a step like is needed to add individual default values to a “list of text” for my user’s “training zones”:

Would be a HECK of a lot easier to just allow us a “default” field like most other fields allow in Bubble, so we can define a static array of simple text values. I can’t believe I’m doing this right but at least it works for now… I mean every app needs default values for dropdown lists for user’s, surely there must be a way to define a static array of text items but I can’t seem to find it…

1 Like

When a user creates an account, then run the workflow to make changes to the current user and add the default values to the list

1 Like

That’s what I did. And it sucks. It puts static config data that my app needs and forces me to inline that data with workflow/code. Therefore maintenance is a pain, etc etc. I just don’t understand how can’t define static text to be used by the app in a list. But, there’s a lot about this platform like that.

You can also setup a Database Trigger on that datatype with the condition User before change is empty (implying it was just created) and set the list field to Arbitrary text, inside that you do your list of texts separated by a newline then after the arbitrary text do :split by ( [newline] )

Then at least you don’t need the option set and don’t need to maintain that field whenever you make a User

1 Like

The maintenance requirement of adding the default values via the workflow rather than via the data field default value is no different as there is only a single place in the app you should be creating users from, so only a single place you’d need to make any changes to those values if you do change (because it would either be the default field in database or the workflow).

Bubble doesn’t let default values be a list for some reason, and do not try to understand why Bubble does/does not allow/do certain things. It will drive you mad. I’ve submitted about 20 bug reports over the past 3 weeks about issues in editor to have 90% come back as ‘this is intended behavior’ because the engineers who put it together made incorrect assumptions.

1 Like

Great idea!!! Thanks!!

Appreciate the feedback, we can agree to disagree about the maintenance aspect but I hear you LOUD and CLEAR about this platform… I chose it to build an app for a friend so he would have a somewhat easy future maintenance platform for managing his site since he has zero tech knowledge. But, building on this platform anything but the most simple app is a harsh reality and learning curve. I’ve made it work but can’t say I’d recommend it to anyone going forward. Thanks for the insight.