Expression properties are special properties that can handle logic. The value of these properties are not set by users like most properties, but can change depending on how the expression is evaluated. Within Betty Blocks there are many types of expression properties, these types determine how the output will be formatted.
- Go to the Data Model by clicking on the Data Model icon in the Builder Bar.
- Click on a model you’d like to add the expression property to or, create a new model for the property.
- Within the model settings, go to the Properties subview on the right.
- Click on the New button to create a new property.
- Select the property type, this should be an expression property. All expression properties are placed on the lower half of the list in a separate category. Take a look at the following article to learn more about the different property types: Property Reference.
- Name the expression property. The Label value will automatically be the same as Name, the Label value can be changed without changing Name. The difference between these two is that Name is inserted into the database of your app and Label is only used for your interfaces as columns or form components.
- Complete the expression field. Click on the Insert variable button at the bottom right of the input field to insert variables in the expression. If you want to know which expressions can be used within the expression field, this article might help you out: Expression Reference.
- If you are done with creating the property you can click on the Save button to save it. After saving (and a change has been applied to the expression), the application will automatically start recalculating the affected records. Be cautious with big databases.