An entity describes a kind of information your app stores. A record is one instance of that kind, with values for its fields.
Entities describe the structure
In Data Model, tables describe the kinds of information your app needs. Each entity has fields that describe what a record can hold.
Consider a client request app. These names and values are an example:
| Entity | Fields | Example record |
|---|---|---|
clients | Name and email address | A client named Northwind |
requests | Title, description, and status | A request titled Replace the lobby sign |
The requests entity defines the structure. The request titled Replace the lobby sign is one record with that structure.
A page is not an entity. A page can display records or let people enter values, but the data model describes the stored information.
Fields describe values and rules
A field describes one part of a record, such as a request's title. Its type describes the kind of value it holds, such as text.
A required field must have a value. An optional field can be empty. For the example app, you can require a request title but allow an empty description.
A change to a field is different from a change to one record:
- Add a
delivery_notesfield when requests need a new kind of information. - Change one request's description when only that request needs different text.
Existing records matter when you change the structure. If you add a required field, decide what values existing records should have. Do not leave Orbit to guess those values.
Relationships connect records
A relationship describes how records refer to other records. For the example app, each request can refer to one client, while one client can have several requests.
The client record and the request record remain different records. The relationship states which client belongs to the request.
Whether that relationship is required is a separate rule. If requests can arrive before you know the client, an optional client link can represent that case.
A relationship in the data model does not prove that a page lets people select a client. The page must also support that choice.
A model check is not a live app test
Data Model lets you inspect tables, links, and field rules. Check those parts against the information your app needs to store.
That check does not prove that a page displays a field, that a form uses a relationship, or that your live app has the change.
For the example request, the model check asks whether requests have a title and a client link. The app test asks whether people can use those values.
Next steps
Define a data model to describe your app's information to Orbit Agent.
Use Add a field for a new value on an existing entity, or Link records for a relationship.
After a model change, edit a mockup to inspect the pages that need the data.