My question is about what happens when I Deploy my dev app to Live? (I can’t easily test this on a temporary app because I need a paid subscription toto deploy, and I don’t want to make a mistake with the Live app.
It’s my understanding that the new data type and new fields will be pushed to the live app, but with no data in them.
What if a field is set with a default value? Will the Live database new fields take on the default value?
How can I populate the new fields with a value for every user? For example, I have a new user preference and I want to set the default value for that preference so that the function will work correctly.
Is there an elegant way to handle this scenario? Is there something I can do to make it easier next time?
Default values are for newly created items. Old fields don’t get repopulated.
If a field was previously empty by default but you set some value as default, you can create a BE WF to set the value of the current items field to the new default value.
From this point in, any new thing will have the default set when it is created.
I have added a new data type for a new feature. Some fields have a default value and some do not. After I deploy, do the fields with a default value get that value?
I have existing data types where I added new fields. These fields have default values.
So the question really is if the default values are applied to existing users when the database is updated on deployment, or are default values only for new users?
The default value will only get added when a new data is created.
When you add a new field with a default value, you need to do a bulk workflow to add the default values to the existing data that don’t have the value populated in that field.
In short, default value won’t get added to any existing data.