Models describe the data that your app uses. Example models include:

  • Customers
  • Articles
  • Orders
  • Images
  • Schedules

You can create the models yourself or import (share) models from other apps. For example, importing the user model from System allows you to bind app-specific data like schedules to users (binding models together is done using Relations).

Models consist of attributes. Each attribute describes some important property (for instance, a customer’s address or phone number or an article’s price) and has a data type that defines how the attribute looks and behaves.

Data TypeDescriptionExample use cases
IntegerA number. Allows arithmetic operations, cannot have any decimals1, 2, 3, …
FloatA number. Allows arithmetic operations, can have decimals.Prices
StringPlain text.Use for storing text of all kinds. Also for numbers you do not want to perform arithmetic operations on (such as phone numbers).
BooleanA value that can only be true or false.Completion of tasks, calendar bookings, etc.
Date, Time, Date & TimeStores date and/or time in various formats.Start times, completion times, durations, etc.
StateHas a finite number of values, defined by you.Order status (placed, in progress, done) and similar

All Appivo-models will have a set of system attributes, they cannot be considered read only and are completely managed by the system. They are:

NameData TypeDescription
idIDThe primary key – a globally unique identifier
created_atDate & TimeDate & Time for when the record was created
updated_atDate & TimeDate & Time for when the record was last updated
verIntegerThe records version-number, increments by one every time the record is updated

Also note that your models may get other automatically generated attributes for representing foreign keys.

Example:

Lets say you have a model Order that is related to another Model called Article and lets also assume an Order is always related to exactly one Article then the system will add an attribute to the Order model for storing the identity of the related Article. The name of the attribute depends on how you have named the relationship (the system uses the model names for naming the relationship ends by default, so if you do nothing the relationship-end name will be the same as the models name).

In our example above an attribute called Article_id would be added to the Order-model and its data type would be ID.