Entity Associations - Configuration Guide
Overview
Entity Associations in the GovAssist platform enable relationships between different entities, allowing records to reference and link to records in other entities. This is fundamental for permit systems where permits need to link to inspections, review tasks, applicants, and other related records.
Association Capabilities
| Feature | Description |
|---|---|
| One-to-Many | Parent record links to multiple child records |
| Many-to-One | Child record links back to a single parent |
| Lookup Fields | Pull field values from associated records |
| Display Configuration | Pills or Cards layout for associated data |
| Visibility Control | Show/hide association fields conditionally |
| Form Integration | Associate records during form submission |
Prerequisites
Before configuring associations, ensure:
- Both source and target entities exist
- User has CREATE and UPDATE permissions on
ENTITYresource - Target entity has fields suitable for display (text, number, email, etc.)
- Understanding of which entity is the "parent" vs "child" in the relationship
Section 1: Association Concepts
1.1 Association Types
| Relationship | Description | Example |
|---|---|---|
| One-to-Many | One parent has many children | Building Permit → many Review Tasks |
| Many-to-One | Many children link to one parent | Review Task → one Building Permit |
| Bi-directional | Both entities can navigate to each other | Permit ↔ Inspection |
1.2 Association Field Type
The association field type creates the link between entities.
| Property | API Value | Description |
|---|---|---|
| Field Type | association | Creates entity relationship |
| Stored Value | Record ID(s) | References to linked record(s) |
| Display Value | Configured fields | Shows lookup fields from target |
1.3 Association vs Lookup
| Concept | Purpose |
|---|---|
| Association Field | Creates the link; stores the reference to another record |
| Lookup Fields | Additional fields pulled from the linked record for display |
Section 2: Creating Association Fields
2.1 Adding an Association Field to an Entity
Navigation: Entity Manager → Select Entity → Configure Entity → Add Field → Association
Basic Configuration
| Setting | Field Name | Description |
|---|---|---|
| Field Name | name | Internal field identifier |
| Field Label | label | Display name shown to users |
| Target Entity | reference.entity_id | The entity this field links to |
| Allow Multiple | reference.multi_select | Enable linking to multiple records |
2.2 Association Reference Configuration
Navigation: Field Config → Advanced Configuration
| Setting | Field Name | Description |
|---|---|---|
| Entity ID | reference.entity_id | Target entity to link to |
| Alias | reference.alias | Display alias for the association |
| Fields | reference.fields | Lookup fields to pull from target |
| Label Config | reference.label_config | Field(s) to use for display label |
| Allow Multiple | reference.multi_select | Allow linking to multiple records |
2.3 Lookup Fields Configuration
Select which fields from the target entity should be accessible in the source entity.
Navigation: Field Config → Advanced Configuration → Lookup Fields
Labels:
| UI Element | Label |
|---|---|
| Field Label | "Lookup Fields" |
| Placeholder | "Select lookup fields" |
Allowed Field Types for Lookup:
| Field Type | API Value | Can Be Lookup |
|---|---|---|
| Text | text | Yes |
| Number | number | Yes |
email | Yes | |
| Textarea | textarea | Yes |
| Formula | formula | Yes |
| Association | association | No |
| File | file | No |
| Image | image | No |
Filter Configuration:
| Filter | Field Types |
|---|---|
| Excluded | association, file, image |
| Allowed | text, number, email, textarea, formula |
2.4 Display Label Configuration
Configure which field displays as the association's label in forms and views.
Navigation: Field Config → Advanced Configuration → Choose field to show in form
| Setting | Description |
|---|---|
| Label | "Choose field to show in form" |
| Placeholder | "Select field to show in form" |
| Selection | Single field from target entity |
The selected field's value will be used as the display text when showing the association in forms and views.
Section 3: Association Display Configuration
3.1 Layout Types
Association fields support two display layouts in forms:
| Layout | API Value | Description | Best For |
|---|---|---|---|
| Pills | pills | Compact inline badges | Single field display, lists |
| Cards | cards | Expanded card with multiple fields | Detailed information display |
Configuration Location: Form Builder → Field Configuration → Layout Type
3.2 Pills Layout
The pills layout displays associated records as compact inline badges.
| Property | Description |
|---|---|
| Display | Single line, inline badges |
| Fields Shown | One field only (first visible field) |
| Best For | Names, IDs, status values |
| Multi-select | Shows multiple badges separated by ` |
Visual Example: John Smith | Jane Doe | Bob Johnson
3.3 Cards Layout
The cards layout displays associated records as expanded cards with multiple fields.
| Property | Description |
|---|---|
| Display | Vertical card with grid layout |
| Fields Shown | Multiple fields in 2-column grid |
| Best For | Contact info, detailed records |
| Includes | Field labels and values |
Card Layout Structure:
| Row | Column 1 | Column 2 |
|---|---|---|
| Header | Record Label | |
| Row 1 | Field 1: Value 1 | Field 2: Value 2 |
| Row 2 | Field 3: Value 3 | Field 4: Value 4 |
3.4 Visible Fields Configuration
Control which fields from the associated record are displayed.
Navigation: Form Builder → Field Configuration → Fields (Visible Fields)
| Setting | Field Name | Description |
|---|---|---|
| Label | "Fields" | UI label |
| Storage | visible_fields | API field name |
| Selection Mode | Single (Pills) / Multi (Cards) | Based on layout type |
Selection Behavior:
| Layout Type | Selection Mode | Description |
|---|---|---|
| Pills | Single | Select one field to display |
| Cards | Multiple | Select multiple fields for the card |
UI Labels:
| State | Text |
|---|---|
| Single field selected | "1 visible field" |
| Multiple fields selected | "N visible fields" |
| No selection (single mode) | "Select a field" |
| No visible fields | "No visible fields selected" |
| All visible | "All fields are visible" |
3.5 Layout Type Selection
| Label | Description |
|---|---|
| UI Label | "Layout Type" |
| Description | "Select how associated records will be displayed" |
| Visible Fields Description | "Select which fields should be visible (Pills layout: single field, Cards layout: multiple fields)" |
Section 4: Association Filters and Visibility
4.1 Conditional Visibility
Association fields can be shown or hidden based on conditions.
Navigation: Form Builder → Field Configuration → Conditions → Visibility
| Setting | Field Path | Description |
|---|---|---|
| Visibility Conditions | association_filters | Conditions that control field visibility |
4.2 Visibility Options
| Option | Value | Description |
|---|---|---|
| Always show | Default | Field is always visible |
| Based on condition | association_filters | Show only when conditions are met |
4.3 Association Filters Structure
Association filters use the advanced filter structure:
{
operator: 'and' | 'or',
conditions: [
{
field: string, // Field to evaluate
operator: string, // Comparison operator
value: any // Value to compare against
}
]
}
4.4 Filter Operators
For String Fields:
| Operator | Value | Description |
|---|---|---|
| Contains | ilike | Case-insensitive substring |
| Equals | eq | Exact match |
| Does not equal | ne | Not equal |
| Is empty | is_null | No value |
| Is not empty | is_not_null | Has value |
| Is any of | in | In list |
| Is none of | nin | Not in list |
For Number Fields:
| Operator | Value | Description |
|---|---|---|
= | eq | Equal |
!= | ne | Not equal |
> | gt | Greater than |
>= | gte | Greater or equal |
< | lt | Less than |
<= | lte | Less or equal |
Section 5: Associations in Views
5.1 Grid View Display
In grid views, association fields display as:
- Single Association: Shows the label config field value
- Multi Association: Shows comma-separated values or badge count
5.2 Kanban View Display
In Kanban cards, associations can be configured via the Customize panel:
- Add association field to card display
- Shows as pills or configured display
5.3 Form View Integration
In forms, associations provide:
- Dropdown/multi-select for record selection
- Search functionality for finding records
- Create new record inline (if configured)
- Display of associated record details
5.4 Record Detail View
When viewing a record, associations show:
- List of associated records
- Quick navigation to associated record detail
- Count of associated records
Section 6: Permitting Association Patterns
6.1 Permit → Review Tasks Pattern
Use Case: Link a permit to its review tasks for workflow tracking.
| Setting | Value |
|---|---|
| Association Name | Review Tasks |
| Type | One-to-Many |
| From Entity | Building Permit |
| To Entity | Review Task |
| Allow Multiple | Yes |
| Lookup Fields | Review Type, Status, Reviewer, Due Date |
| Layout Type | Cards (for detail) or Pills (for summary) |
On the Permit Side:
- Field:
review_tasks(association, multi-select) - Display: Shows all review tasks with status
On the Review Task Side:
- Field:
parent_permit(association, single-select) - Display: Shows permit number/type
6.2 Permit → Inspections Pattern
Use Case: Link permits to scheduled inspections.
| Setting | Value |
|---|---|
| Association Name | Inspections |
| Type | One-to-Many |
| From Entity | Building Permit |
| To Entity | Inspection |
| Allow Multiple | Yes |
| Lookup Fields | Inspection Type, Scheduled Date, Result |
| Layout Type | Cards |
6.3 Permit → Applicant Pattern
Use Case: Link permits to applicant/contractor records.
| Setting | Value |
|---|---|
| Association Name | Applicant |
| Type | Many-to-One |
| From Entity | Building Permit |
| To Entity | Constituent |
| Allow Multiple | No |
| Lookup Fields | Name, Email, Phone, License Number |
| Layout Type | Cards |
6.4 Parent-Child Permit Pattern
Use Case: Link trade permits to their parent building permit.
| Setting | Value |
|---|---|
| Association Name | Parent Building Permit |
| Type | Many-to-One |
| From Entity | Trade Permit |
| To Entity | Building Permit |
| Allow Multiple | No |
| Lookup Fields | Permit Number, Property Address, Status |
| Label Config | Permit Number |
| Layout Type | Pills |
6.5 License Renewal Pattern
Use Case: Link renewed licenses to their previous version.
| Setting | Value |
|---|---|
| Association Name | Previous License |
| Type | Many-to-One |
| From Entity | License |
| To Entity | License (same entity) |
| Allow Multiple | No |
| Lookup Fields | License Number, Issue Date, Expiration Date |
| Layout Type | Pills |
Section 7: Associations with Automations
7.1 Create Associated Records
Use automations to create linked records automatically.
Trigger: When permit is submitted Action: Create Review Task record with parent association set
7.2 Update Associated Records
Update multiple associated records based on parent changes.
Trigger: When permit status changes to "Approved" Action: Update all associated review tasks to "Completed"
7.3 Rollup/Summary from Associated Records
Use formula fields to aggregate data from associations:
- Count of associated records
- Sum of values from child records
- Latest date from associated records
Section 8: Best Practices
8.1 Association Design Principles
- Clear Direction: Decide which entity is the "parent" (one) vs "child" (many)
- Naming Convention: Use descriptive names like
parent_permit,review_tasks - Minimal Lookups: Only pull fields you actually need to display
- Appropriate Layout: Use Pills for simple references, Cards for detailed info
8.2 Performance Considerations
| Consideration | Recommendation |
|---|---|
| Lookup Count | Limit to 5-7 lookup fields per association |
| Nested Associations | Avoid associating to associated records |
| Multi-select Size | Consider UI impact of many associated records |
8.3 Common Pitfalls
| Issue | Solution |
|---|---|
| Circular associations | Use clear parent-child hierarchy |
| Too many lookup fields | Only include fields needed for display |
| Unclear field naming | Use convention: parent_[entity] or [entity]_list |
Troubleshooting
Common Issues
Association Field Not Showing Records
Check:
- Target entity has records
- User has VIEW permission on target entity
- No visibility conditions are hiding the field
- Label config field has values in target records
Lookup Fields Not Displaying
Check:
- Lookup fields are configured on the association
- Field types are allowed (text, number, email, textarea, formula)
- Target record has values in those fields
Cannot Create Association
Check:
- User has CREATE permission on ENTITY resource
- Target entity exists and is accessible
- Entity configuration is saved
Pills Showing Wrong Field
Check:
- Review visible_fields configuration
- Pills mode only shows first visible field
- Verify label_config is set correctly
Code Reference
Source Files
Association Field Configuration
| File | Location | Purpose |
|---|---|---|
| Associated Field Config | entity-manager-app/src/pages/Entity/ConfigureEntity/EntityBuilderSidebar/CustomFieldConfig/AdvanceConfiguration/components/AssociatedFieldConfiguration/ | Association field settings |
| Associated Field Constants | AssociatedFieldConfiguration/consts.ts | Labels, placeholders, filters |
Association Display
| File | Location | Purpose |
|---|---|---|
| Associate Badge | entity-manager-app/src/components/AssociateBadge/ | Pills display component |
| Visible Fields | entity-manager-app/src/pages/public/PublicForm/components/AssociationVisibleFields/ | Field visibility display |
| Visible Fields Selector | entity-manager-app/src/pages/Form/ConfigureForm/FormBuilderPreview/FieldConfiguration/Components/VisibleFieldsConfiguration/ | UI for selecting visible fields |
Layout Configuration
| File | Location | Purpose |
|---|---|---|
| Layout Constants | entity-manager-app/src/pages/Form/ConfigureForm/FormBuilderPreview/FieldConfiguration/const.ts | Layout type options |
| Field Types | govt-assist-shared/src/const/fieldTypeConstants.ts | Association field type definition |
Condition Configuration
| File | Location | Purpose |
|---|---|---|
| Condition Config | entity-manager-app/src/pages/Form/ConfigureForm/FormBuilderPreview/FieldConfiguration/Components/ConditionConfiguration/consts.ts | Visibility condition options |
| Advanced Filter | entity-manager-app/src/pages/Form/ConfigureForm/FormBuilderPreview/FieldConfiguration/Components/AdvancedFilter/ | Filter configuration UI |
API Constants
// Layout Type Options
LAYOUT_TYPE_OPTIONS = [
{ value: 'pills', label: 'Pills' },
{ value: 'cards', label: 'Cards' },
];
// Association Field Filters (for lookup fields)
ASSOCIATED_FIELD_FILTERS = {
EXCLUDED_TYPES: ['association', 'file', 'image'],
ALLOWED_TYPES: ['text', 'number', 'email', 'textarea', 'formula'],
};
// Field Type
FIELD_TYPES.ASSOCIATION = 'association';
Related Documentation
- Form Builder Guide - Association field in forms
- View Configuration - Association display in views
- Role-Based Access Control - Entity permissions
- Automation Builder - Automating association creation
This guide is aligned with the entity-manager-app codebase as of January 2026.