Data Templates page, similar to Styles but for Data

regarding the “initial value” option for fields defined at Types that I had mentioned by e-mail and also iterated a bit in the “Deleted event” post in the forum, had some more thinking on it

you could have Data Templates page (like you have Styles page for UI elements). A Data Template would have a name and a Type and would show a property page for all fields of that Type to set values to (optionally). The primitive fields would show the default value Bubble puts to them (0 for numbers for example I guess) and the user could edit it (if the field keeps its default value you don’t need to remember it in the template storage btw)

For fields that have a non-primitive Type, you could show a dropdown to select another Data Template for them, or select to make a new DataTemplate for that field’s type if there is none to select from (similar to how you do when you select a Style for an element that is)

So then, in the Data tab, when you define a Type, you could select a Data Template you want to use for it and also when you define fields for a type, you could select which Data Template you want for them or what initial value if they’re primitive ones (although you could opt to go for Data Template selection for primitives too there). If a DataTemplate is selected for a Type, then if a DataTemplate is also selected for a certain field of it, it would override the value set for that field (if any) by the DataTemplate selected for the whole type. Like Cascading DataTemplates that is

1 Like