Settings
...
Properties
Default values and prefilling
12 min
for definition properties, it is possible to add a 'default value' or 'prefill data' when creating a related entity this feature does not apply when updating an entity, only when creating a new one feature config turning on the feature this feature can be enabled for each property by turning on in the 'prefill logic' tab and by toggling the switch for an 'entity' type property, this toggle switches both the 'default value' and 'prefilling' of the entity upon creation (see below) set default value after the toggle switch, you see an input field that corresponds to the current property type— text, number, rich text, and so on 'default value' setting tab for a property toggle switch to turn the feature on and off input field for default value if you enter a value in this field, and the feature is enabled, the frontend will display the default value in the drawer of adding a new item also, if a new entity is created without the frontend, the backend will also supply the default value for 'date' type properties, you can specify a computed expression using date operators (see https //docs hyperportal org/date ) the 'today()' and 'now()' operators can be used as a date value if you specify a computed expression that cannot be evaluated as a date, the default value will be 'null' this feature only works for properties that are not populated by the system, for example, the following properties cannot be assigned a default value entityid, createdat, updatedat, etc you also cannot set default value settings for properties that have been specified as 'computed' prefill for properties of the 'entity' type, you can configure a prefilling for the new entity, which will be applied when creating a new entity from the current property this setting will only work on the frontend, so if you configure it, the backend will not prefill the configured value, but will only prefill the specified default values default value setting prefill value setting since this setting only works on the frontend, you can specify computed expressions here, taking into account the context of the entity from which the add new entity dialog will be called the expression can reference the properties of the current entity and the operators available for the computed expression editor unavailable properties if previously selected properties have been removed in a relation definition, or the current user does not have permissions to access it, you will see a ' warning' icon and a tooltip informing you of this how the feature works first of all, you can always remove a default value by deleting it from the property you can do this by using the 'reset' button for some properties, such as 'entity' or 'date', or by clearing them with the 'delete/backspace' key delete current default value below are examples of how the 'default values' and 'prefill' settings will be applied scenarios creating a new entity properties with configured 'default values' are filled with these values the backend will also populate these properties with 'default values' unless a forced reset is performed clone an existing record the properties of the new entity are filled with the values from the properties of the cloned entity where the cloned entity has no value, but a 'default value' is configured for this property, the default value is substituted the backend will also fill in these properties with 'default values' unless a forced reset is performed creating a new entity from a property of the current entity properties with configured 'prefill' are filled with these values then, if no prefill values were used, the 'default value' from the properties of the definition whose entity you are adding is applied the backend will populate these fields only with 'default values' unless a forced reset is performed the backend is unaware of 'prefill' how does this work from ui create a new item 'add a new item' button properties with value by default create a nested new item with 'prefill' create a new nested item (table view) create a new nested item (detail entity view) prefilled values 'default value' for properties of nested definition item cloning an existing value cloning item filled from cloned item 'default value'