Getting started with data model

Learn how to build the first model in your Betty Blocks application.

Updated over a week ago

After reading this article you’ll know:

  • The ways of setting up your first data model

  • How to add new properties to the model

Data models define and store your application's data. It consists of multiple models, properties, and their connections (relations). In this article, we will learn how to create a new model for your application.

Open your applications dashboard and go to the data model quick sidebar menu. Click on the ‘+’ icon to create a new data model (1). Two buttons below it will bring you to the schema view (2) and data models list overview (3).

Data model quick menu

It’s also possible to create a new model from the list overview. To do this, choose the ‘New model’ option.

Creaing a new data model
  1. So, click on either the ‘+’ icon in the quick menu or the ‘New model’ button in the list overview.

  2. In the pop-up window, apply the appropriate name for your model. It’s recommended to use a singular form.

  3. Click on the ‘Create model’ button once you come up with a name for your model.

Creating a new data model

By default, the following properties are included in all models:

  • Created at

  • ID

  • Updated at

You can use the ‘New property’ button to assign additional properties for your model. Also, it’s possible to do that with the ‘Quick add properties’ option that enables users to add properties with the default settings. Learn more about adding and setting properties in this article.

Tips for building your data model

  • We recommend not using more than 20 properties per model

  • We recommend to not have more than 5 relations per model (to other models)

  • Try to keep your data model permission levels filtered on max 2 layers. If you filter data over more than 2 layers your data handling will get slower.

Index values

In your property settings, you have the option to turn on the “index values” option. This allows you to load a set of your property data when loading on the page. This allows for faster search results when searched for.

Make sure to turn on the index values option when you expect a property to be searched for often (think of names and email addresses), don’t use it on items not searched for often, causing it to make the page you are using data on much heavier (specific dates, ID’s. descriptions as example).

Did this answer your question?