How to create expression properties

Sam van de Kreeke

Published: 18-10-2019

Last updated: 27-08-2020

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.

  1. Go to the Data Model by clicking on the Data Model icon in the Builder Bar.
  2. Click on a model you’d like to add the expression property to or, create a new model for the property.
  3. Within the model settings, go to the Properties subview on the right.
  4. Click on the New button to create a new property.
  5. 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.
  6. 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.
  7. 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.
  8. 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.

Not sure where to start?

Click here to register and start learning