Before diving into entities, it's important to understand that a record can have a one-to-many relationship with other records, such as test scores and relationship records in Slate. A common one-to-many relationship in Slate is a prospective student having multiple school records representing their academic history.
So what are Entities? Entities are custom objects/scopes exclusive to your database. A record can have a one-to-many relationship with an Entity; moreover, an Entity can belong to a person record, application record, or dataset record. Example entities include scholarships, class schedules, and more.
You can use entities to gather and display data in the following Page Construction-scoped forms:
- Person Page (to be viewed on custom person tabs)
- Application Page (for custom application tabs and pages in the Slate-hosted application).
Custom Entity Examples
A person can have multiple scholarships. In this case, you can create a "Scholarships" Entity with corresponding scholarship-scoped fields:
A person can have multiple courses. In this case, you can create a "Class Schedule" Entity with corresponding class-scoped fields.
Entities require the following configurations:
- Create the object (entity).
- Create entity-scoped fields that will be associated with the entity.
- Create an entity widget form to collect data associated with the entity.
- Refresh the Configurable Joins Library.
- Return to your entity widget form and add your Custom List Fields in the Edit Properties menu.
- Embed the entity widget form. You can embed the widget form in Slate forms, such as a custom tab or inside a Slate application.
Create the Entity
When creating an entity, all data points that should be stored will require custom fields to store them.
Considerations before creating an entity-scoped field:
- Does this field need to store one value per entity entry or multiple values?
- Does the field include a predetermined list of values, or does it collect free text?
- If storing multiple values, should new values be added to the field, or should the new values replace the previous ones?
- Is this value you are trying to store something unique per entity entry?
Create Entity-Scoped Fields
Once the Entity has been created, create entity-scoped fields:
Datasets - Slate can relate Entities to a Dataset by using a field with the Data Type of "Related Dataset Row."
Unique for Merging - Entities require a custom configuration to ensure that incoming entity data can match existing entity data. Wherever you collect this data, you should include the unique for merging field. Some examples of useful unique for merging fields include:
- GUID of the entity row
- A unique ID (e.g., from an external system)
- A Concatenate Field (e.g., data from two custom entity fields)
Create an Entity Widget Form
You can use an entity-widget-scoped form to collect entity data. Once configured, you must then add the entity widget-scoped form to either an application page-scoped form or a person page-scoped form.
Entity data can be collected on other types of forms by adding entity-scoped fields directly to the form or by using a replicate block.
The Custom List Fields area in Edit Properties allows you to define columns (exports), filters, and sorts. This controls what values appear on Forms that use the widget.
Populate the form with the desired entity-scoped fields. These fields should represent the data that should be collected and stored for each entity entry. For example, Class Name, Class Status, Midterm Grade, and Final Grade.
Collect and Display the Entity Data
(Option 1 - Preferred): Embed an Entity Widget
With the widget created, embed the widget in a custom tab or inside a Slate application:
(Option 2 ): Mapping Individual Fields on a Form Without a Widget