Set default for all existing records when creating a new field

Hey. Apologies if this is answered somewhere.
When I create a new field, I’d really like to be able to set the default value to apply to all existing records in that table for that new field.
What I do now sucks: create a new API workflow and then select all records in the App data tab and then run that workflow on them. Surely that could be done from within the Create new field modal if there were an option that said “apply to all records when pushed to Live”.

1 Like

on page load or whenver you want this to fire you can go to “data(things)” and then “make changes to a list of things”

No-one else feels this way? This is so weird.
Bubble, do you really want us all creating API workflows to set the existing things to the new field’s default value? Such a pain in the …

It might be that it’s just too risky? It’s convenient for a straight-forward use case and/or not a lot of records are involved, but there are other things to consider too:

  • Existing records may have a mix of intentional blank values or different values that shouldn’t be overwritten. Even if it’s a minority of the dataset, you still have to separate them.

  • Applying a default to all records could mean a massive bulk update operation. Yes, a manual workflow is doing the same, but at least with a manual workflow you have control over which records, timing, other dependencies, etc.

  • Dependencies. What if there are database trigger events linked to that field doing all sorts of backflips? Depending on the size of the existing database, this could be another resource intensive ripple effect.

I think if a setting like this were introduced, there would need to be a warning of risks.

for me the problem is larger. I share point about having to define a new default value for existing things. You have to bulk all the DB. Same thing when you have to upgrade your data model value because a feature that. all that cost a lot of WU and you have no choice on that.
It’s a real pain for evolution

Yeah, those are great points Gaby, when we’re talking about changing a default on existing fields. @romanmg But I’m talking about creating a new field.
I would say it’d be unlikely that there’d be triggers already created for this new field. But the overall burden could be big if there are a really big number of the things in the DB and people would for sure need to be warned.