Blog

How to configure the default value for a data table column

by on April 9, 2015

As data objects are being saved or updated with the API requests some properties of the objects may not have a value assigned to them. It may be necessary that for those properties a default value is assigned. This is identical to how relational databases may have a default value for a column.

Configuring a default value for a column is very easy. You can set it when you declare a column or after a column is already created.

The popup window for creating a new column includes a field where the default value can be set:

Alternatively, when a column already exists in a table schema, there is a field which displays and lets you edit the default value:
Once a default value is assigned to a column, it becomes immediately effective. When an object is saved or updated does not have a value for a property corresponding to the column, Backendless inserts the default value.