Object class properties
Last updated
Was this helpful?
Last updated
Was this helpful?
An Object Class represents the entity or the table, whereas Object Class Properties represents the table columns. The rows in this table are referred to as Objects, whereas the columns and the Object properties.
The description of the table columns is the Object Class Properties. Some examples are Name
, Quantity
or Created Date
. Every object class has some and you can add your own properties.
To add a property to an object class you can either:
Right-click on an object class, in either the table or diagram view of the and select Add property
Click the Add property button when an object class is expanded in the table view of the .
Each property has a Data Type, which determines the format of the value allowed in the database. Data types include
Simple data types: Boolean, String, Integer, Float, Datetime, Duration, Internet URL, Image URL, and Rich Text
References to Object Classes. For example, the property Contact.Company
may have Data Type Company
. In this case, the reference to a Company
(the id
of the Company
) will be saved into the database for Contact.Company
.
References to . For example, you may define an Enum Order Status
. The property Order.Status
may have Data Type Order Status
. In this case, the value
of the Enum-entry will be saved into the database for Order.Status
.
Each property has a Property Type as either Value or Function. Most properties are values.
Values are stored in the database
Functions are calculated runtime and never stored in the database. For example, you may define a property Full name
for the Person Object Class, with a Function return Firstname + " " + Lastname
.
Additionally, if the Data Type is a reference to another Object Class or Enum, you may define the Cardinality as either One or Many.
One: This is the default. Only a single ID (for Object Class references) or Value (for Enum references) may be stored in the database for this object class property. This is used for One-to-Many or One-to-One relationships.
Many: Allows storing many IDs (or Values, for Enums references) in this Object Class Property. An array of IDs (or Values) will be stored in the database. You may treat this property as a many-cardinality data source in your Apps or Services in the business logic or UI: You may add or remove references from the array of IDs/Values using Action Node, and iterate the Object Class Property in a Action Node or a or in your UI. Cardinality Many is used for Many-to-Many relationships.
Many-cardinality: Example of a good use case: Person.Tags
may be a Many-cardinality Object Class Property, referencing the Tag
object class. You only need to store the fact that a person has a set of Tags or not - not e.g. when the Tag was added to the Person. You may add or remove Tag
IDs from Person.Tags
property using the Update Object action node, and you may iterate Person.Tags
in a action node (similar to a data source with cardinality Many).
Many-cardinality: Example of a not-so-good use case: Project.Members may be a Many-cardinality Object Class Property
Warning
Once you have data stored in an object class, it is not recommended to change Node Name, Data Type, Cardinality or Property Type. Doing so can cause inconsistency in your data.
These properties are added to each object class and the values are populated when an object is created or updated.
ID
Created Date
A read-only datetime property containing the date and time an object was created. When you create a new runtime object the Created Date (and Created By) properties will be set client-side. When the object is persisted these values will be overwritten server-side and the client will be updated to reflect the actual values stored in the database.
A database-connected object will be persisted immediately, so the difference between the client-side Created Date and the server-side Created Date should be negligible. After a refresh of the object the server-side Created Date will be visible in the client.
Update Date
A read-only Datetime property containing the date and time an object was last updated.
File Content URL
A read-only internet URL property containing the URL of the file. Unless the file has been set as Public upon creation, a File Content URL will expire 12 hours after first being loaded into an app. If a file has been set as Public, the URL will not expire.
File Size
A read-only integer property containing the size of the file in bytes.
Is Public
Mime Type
A read-only string property containing the MIME type (external link) of the file.
Original File Name
Upload Complete
A read-only boolean property indicating if the file has been uploaded in full. A file created in a runtime data source is not considered uploaded until it has been persisted.
Upload Progress
A read-only float property indicating the progress of the file upload as a percentage. A file created in a runtime data source is not considered uploaded until it has been persisted.
Property Name
The name used throughout Appfarm Create to refer to this property. This name can be changed at any time without technical consequences.
Node Name
The name used by the database to store data for this property. This name should consist only of letters or digits. Warning: Once you have data stored in an object class, it is not recommended to change this value. Doing so can cause inconsistency in your data.
Description
A longer description of the property. For your own reference.
Data Type
Cardinality
One: This is the default. Only a single ID (for Object Class references) or Value (for Enum references) may be stored in the database for this object class property. This is used for One-to-Many or One-to-One relationships.
Many: Allows storing many IDs (or Values, for Enums references) in this Object Class Property. An array of IDs (or Values) will be stored in the database. Cardinality Many is used for Many-to-Many relationships.
Property Type
A property can be either a primitive value or a function.
Value
: A primitive value stored in the database.
Value on Create
Available for Value property type. A default value to set for the property when a new object is created.
Enable Advanced Search
The database will index this property and enable server side search with the Advanced search Action Node. Enabling this will lead to some extra storage space consumption. Advanced search can be enabled for String and Rich Text properties. Note: generating database indices can take 5-15 minutes after enabling advanced search.
Function
All properties must be assigned a data type, defining what kind of data they store.
Boolean
A truth value true
or false
. Can also be undefined.
String
Text with support for all types of characters.
Integer
A whole number.
Float
A floating point number with a decimal point.
Datetime
A timestamp in ISO 8601 format:
YYYY-MM-DDThh:mm:ss:fffZ.
Duration
Internet URL
A website URL.
Image URL
An image URL.
Rich Text
Enum
Reference
A reference to another object class. This creates a one-to-many relationship between the property's object class and the reference object class.
Label True
A text label to display when the value is true.
Label False
A text label to display when the value is false.
Label Undefined
A text label to display when the value is undefined (empty) or null.
You have an object class Event
with a boolean property Open for registration
. You want to display text in the UI based on the value of that property for each event.
Assign the following boolean labels:
Label True: Open for registration
Label False: Closed for registration
Label Undefined: Not yet open for registration
We also recommend enforcing the same validation in your UI in order to provide the best possible user experience.
Read Only
Required
A value must always be provided for this property.
Unique
The value provided must be unique across all objects of this object class.
Maximum Length
Available for String data type. The maximum number of characters allowed.
Regular Expression
Available for String data type. A regular expression that the string must match.
Minimum Value
Available for Integer and Float data types. The minimum value allowed.
Maximum Value
Available for Integer and Float data types. The maximum value allowed.
Delete Rule
Available for Reference data type. Control the effect of objects deleted in the referenced object class. The options are:
None
: Objects in the referenced object class can be freely deleted. This means that objects of this object class may have orphan references pointing to objects that no longer exist. For example, if there are Order Line objects that reference an Order object and that Order object is deleted, the Order Line objects will remain with a reference to an Order that no longer exists.
Delete Constraint
(default): If an attempt is made to delete a referenced object, an exception will be thrown. For example, if there are one or more objects in Order Line with a reference to an Order object, it will not be possible to delete that Order object.
Cascade Delete:
If a referenced object is deleted, so will all objects in this object class that reference the deleted object. For example, an object deleted in Order will also delete objects in Order Line that reference that Order object.
Best practices
The Delete Rule Cascade Delete
can remove complexity from your logic and ensure data consistency, but it should be used with caution. When an object is deleted and the rule is triggered, it will automatically delete all objects that reference the deleted object.
It is typically used when you have a structure with a parent object class and a child object class. When the parent is deleted, you also want to delete all the children. For example, you have two object classes Order and Order Line. Each order line object has a reference to an order object, its parent. In this case Cascade Delete
will ensure that when an order is deleted, all the associated order lines are deleted.
Not all parent-child relationships warrant the use of Cascade Delete
though, particularly when you want to retain history. For example, an Employee may be referenced by many Project objects as the Project owner. If the employee leaves the company and their associated object is deleted, you probably don't want to also delete all their projects which are important company records.
If you're unsure about the which rule to use, keep it set to Delete Constraint
. You can always begin by using action nodes to first delete the child objects and then delete the parent. Then, when you are confident in your data model, you can switch to deleting only the parent and using Cascade Delete
.
GDPR Classification
A privacy classification for the data stored in this property. The options are:
None
: This property does not store personal information.
Personal
: This property stores personal information. For example name, address, phone number, email address, social security number, or profile picture.
Sensitive:
This property stores sensitive personal information. For example ethnic origin, political views, religion, health information, or sexual orientation.
GDPR Details
A description of why this information is collected and stored and how it is used. For your own reference.
A read-only property with an automatically generated unique identifier. Note that ID values are sequential and therefore guessable. If you need to expose a unique reference to an object, consider using the property.
The Updated Date (and Updated By) properties are treated in the same way. The values are set client-side when an object is modified with the , or when changed using a UI component. For database-connected data sources the values will also be set server-side during this operation, while for a runtime data source the values will be updated on persist.
There are additional built-in properties for objects created in a file object class to store file metadata. These are populated automatically when you use the or other action nodes that create objects in file object classes.
A read-only boolean property indicating if the file is available to unauthenticated users. This property can be set through the .
A read-only string property containing the file name. This property can be overwritten through the .
The type of data allowed to be stored in this property. See . Warning: Once you have data stored in an object class, it is not recommended to change this value. Doing so can cause inconsistency in your data.
Function
: A that calculates a value at runtime and which is not stored in the database. For example, a function that concatenates first name and last name properties and returns a full name.
Available for Function property type. A that calculates and returns a value at runtime.
An integer number for holding a (in ms).
Formatted text for use with the .
A custom or built-in .
Available for Boolean data type. For boolean properties you can define text labels for the true, false, and undefined/null values. You can then bind the property in a , Select, or component and the appropriate label will be displayed based on the value. Boolean labels can help reduce complexity in the and can replace the use of enums in some cases.
Then, bind the property to a on an Event details
view in the Ul. The appropriate label will be displayed based on the property's value for that event.
You can apply data validation checks to a property. These checks are run when data is persisted. If a check fails, an exception will be thrown. In order to handle this scenario you should use the .
If selected, the property can only be assigned a value using the or the Value on Create property. Read Only properties that are attempted to be updated with an action node are filtered out with a warning.
GDPR settings may be configured per Object class property. Also, see the section of the Object classes article.