AutoBridge

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

FeatureDescription
One-to-ManyParent record links to multiple child records
Many-to-OneChild record links back to a single parent
Lookup FieldsPull field values from associated records
Display ConfigurationPills or Cards layout for associated data
Visibility ControlShow/hide association fields conditionally
Form IntegrationAssociate records during form submission

Prerequisites

Before configuring associations, ensure:

  • Both source and target entities exist
  • User has CREATE and UPDATE permissions on ENTITY resource
  • 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

RelationshipDescriptionExample
One-to-ManyOne parent has many childrenBuilding Permit → many Review Tasks
Many-to-OneMany children link to one parentReview Task → one Building Permit
Bi-directionalBoth entities can navigate to each otherPermit ↔ Inspection

1.2 Association Field Type

The association field type creates the link between entities.

PropertyAPI ValueDescription
Field TypeassociationCreates entity relationship
Stored ValueRecord ID(s)References to linked record(s)
Display ValueConfigured fieldsShows lookup fields from target

1.3 Association vs Lookup

ConceptPurpose
Association FieldCreates the link; stores the reference to another record
Lookup FieldsAdditional 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

SettingField NameDescription
Field NamenameInternal field identifier
Field LabellabelDisplay name shown to users
Target Entityreference.entity_idThe entity this field links to
Allow Multiplereference.multi_selectEnable linking to multiple records

2.2 Association Reference Configuration

Navigation: Field Config → Advanced Configuration

SettingField NameDescription
Entity IDreference.entity_idTarget entity to link to
Aliasreference.aliasDisplay alias for the association
Fieldsreference.fieldsLookup fields to pull from target
Label Configreference.label_configField(s) to use for display label
Allow Multiplereference.multi_selectAllow 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 ElementLabel
Field Label"Lookup Fields"
Placeholder"Select lookup fields"

Allowed Field Types for Lookup:

Field TypeAPI ValueCan Be Lookup
TexttextYes
NumbernumberYes
EmailemailYes
TextareatextareaYes
FormulaformulaYes
AssociationassociationNo
FilefileNo
ImageimageNo

Filter Configuration:

FilterField Types
Excludedassociation, file, image
Allowedtext, 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

SettingDescription
Label"Choose field to show in form"
Placeholder"Select field to show in form"
SelectionSingle 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:

LayoutAPI ValueDescriptionBest For
PillspillsCompact inline badgesSingle field display, lists
CardscardsExpanded card with multiple fieldsDetailed information display

Configuration Location: Form Builder → Field Configuration → Layout Type

3.2 Pills Layout

The pills layout displays associated records as compact inline badges.

PropertyDescription
DisplaySingle line, inline badges
Fields ShownOne field only (first visible field)
Best ForNames, IDs, status values
Multi-selectShows 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.

PropertyDescription
DisplayVertical card with grid layout
Fields ShownMultiple fields in 2-column grid
Best ForContact info, detailed records
IncludesField labels and values

Card Layout Structure:

RowColumn 1Column 2
HeaderRecord Label
Row 1Field 1: Value 1Field 2: Value 2
Row 2Field 3: Value 3Field 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)

SettingField NameDescription
Label"Fields"UI label
Storagevisible_fieldsAPI field name
Selection ModeSingle (Pills) / Multi (Cards)Based on layout type

Selection Behavior:

Layout TypeSelection ModeDescription
PillsSingleSelect one field to display
CardsMultipleSelect multiple fields for the card

UI Labels:

StateText
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

LabelDescription
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

SettingField PathDescription
Visibility Conditionsassociation_filtersConditions that control field visibility

4.2 Visibility Options

OptionValueDescription
Always showDefaultField is always visible
Based on conditionassociation_filtersShow 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:

OperatorValueDescription
ContainsilikeCase-insensitive substring
EqualseqExact match
Does not equalneNot equal
Is emptyis_nullNo value
Is not emptyis_not_nullHas value
Is any ofinIn list
Is none ofninNot in list

For Number Fields:

OperatorValueDescription
=eqEqual
!=neNot equal
>gtGreater than
>=gteGreater or equal
<ltLess than
<=lteLess 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.

SettingValue
Association NameReview Tasks
TypeOne-to-Many
From EntityBuilding Permit
To EntityReview Task
Allow MultipleYes
Lookup FieldsReview Type, Status, Reviewer, Due Date
Layout TypeCards (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.

SettingValue
Association NameInspections
TypeOne-to-Many
From EntityBuilding Permit
To EntityInspection
Allow MultipleYes
Lookup FieldsInspection Type, Scheduled Date, Result
Layout TypeCards

6.3 Permit → Applicant Pattern

Use Case: Link permits to applicant/contractor records.

SettingValue
Association NameApplicant
TypeMany-to-One
From EntityBuilding Permit
To EntityConstituent
Allow MultipleNo
Lookup FieldsName, Email, Phone, License Number
Layout TypeCards

6.4 Parent-Child Permit Pattern

Use Case: Link trade permits to their parent building permit.

SettingValue
Association NameParent Building Permit
TypeMany-to-One
From EntityTrade Permit
To EntityBuilding Permit
Allow MultipleNo
Lookup FieldsPermit Number, Property Address, Status
Label ConfigPermit Number
Layout TypePills

6.5 License Renewal Pattern

Use Case: Link renewed licenses to their previous version.

SettingValue
Association NamePrevious License
TypeMany-to-One
From EntityLicense
To EntityLicense (same entity)
Allow MultipleNo
Lookup FieldsLicense Number, Issue Date, Expiration Date
Layout TypePills

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

  1. Clear Direction: Decide which entity is the "parent" (one) vs "child" (many)
  2. Naming Convention: Use descriptive names like parent_permit, review_tasks
  3. Minimal Lookups: Only pull fields you actually need to display
  4. Appropriate Layout: Use Pills for simple references, Cards for detailed info

8.2 Performance Considerations

ConsiderationRecommendation
Lookup CountLimit to 5-7 lookup fields per association
Nested AssociationsAvoid associating to associated records
Multi-select SizeConsider UI impact of many associated records

8.3 Common Pitfalls

IssueSolution
Circular associationsUse clear parent-child hierarchy
Too many lookup fieldsOnly include fields needed for display
Unclear field namingUse convention: parent_[entity] or [entity]_list

Troubleshooting

Common Issues

Association Field Not Showing Records

Check:

  1. Target entity has records
  2. User has VIEW permission on target entity
  3. No visibility conditions are hiding the field
  4. Label config field has values in target records

Lookup Fields Not Displaying

Check:

  1. Lookup fields are configured on the association
  2. Field types are allowed (text, number, email, textarea, formula)
  3. Target record has values in those fields

Cannot Create Association

Check:

  1. User has CREATE permission on ENTITY resource
  2. Target entity exists and is accessible
  3. Entity configuration is saved

Pills Showing Wrong Field

Check:

  1. Review visible_fields configuration
  2. Pills mode only shows first visible field
  3. Verify label_config is set correctly

Code Reference

Source Files

Association Field Configuration

FileLocationPurpose
Associated Field Configentity-manager-app/src/pages/Entity/ConfigureEntity/EntityBuilderSidebar/CustomFieldConfig/AdvanceConfiguration/components/AssociatedFieldConfiguration/Association field settings
Associated Field ConstantsAssociatedFieldConfiguration/consts.tsLabels, placeholders, filters

Association Display

FileLocationPurpose
Associate Badgeentity-manager-app/src/components/AssociateBadge/Pills display component
Visible Fieldsentity-manager-app/src/pages/public/PublicForm/components/AssociationVisibleFields/Field visibility display
Visible Fields Selectorentity-manager-app/src/pages/Form/ConfigureForm/FormBuilderPreview/FieldConfiguration/Components/VisibleFieldsConfiguration/UI for selecting visible fields

Layout Configuration

FileLocationPurpose
Layout Constantsentity-manager-app/src/pages/Form/ConfigureForm/FormBuilderPreview/FieldConfiguration/const.tsLayout type options
Field Typesgovt-assist-shared/src/const/fieldTypeConstants.tsAssociation field type definition

Condition Configuration

FileLocationPurpose
Condition Configentity-manager-app/src/pages/Form/ConfigureForm/FormBuilderPreview/FieldConfiguration/Components/ConditionConfiguration/consts.tsVisibility condition options
Advanced Filterentity-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


This guide is aligned with the entity-manager-app codebase as of January 2026.