Link Records with an Association Field
An association field links a record in one entity to one or more records in another entity. A Building Permit links to its Contractor License, an Inspection Request links to its Building Permit, a Business License links to its owner Contact. This guide covers creating the link, choosing whether it allows one or many records, showing details of the linked record, and keeping the link visible from both sides.
Prerequisites
- Both entities exist.
- Your role has Configure Entity on the entity that gets the field, and can view the target entity. If you cannot view the target entity, it is not listed, and Association Filters are not available.
Steps
Open the entity's Configure page
Go to System Tools then Entities, click the ⋯ menu on the entity's row, and choose Configure.
Click + on the section
In the Sections pane, click the + button (tooltip Add Field) on the section the link belongs in.
Switch to the Associated tab
In the Create Field panel, click the Associated tab. Under Entities it lists the entities in your application. Use Search to find one.
Pick the target entity
Click the entity whose records this field links to. The panel changes to Configure Field, and the Field Label is filled in with the entity's name.
Rename the field
Change the Field Label to describe the relationship from this side, such as Contractor, Parent Permit, or Business Owner.
Allow one or many linked records
Turn on Allow linking to multiple records if one record can link to several, such as a permit with several inspections. Leave it off if each record links to exactly one, such as a permit's single contractor.
Show the link on both entities (optional)
Turn on Two Way Binding to add a matching field to the target entity, named after this entity. When you link a contractor to a permit, the permit then also appears on the contractor's record.
Choose lookup fields
Under Advanced Configuration, open Lookup Fields and choose the fields of the linked record to show as columns when you view linked records in a grid, such as the contractor's license number and expiration date. Pick at least one. Press Esc to close the list.
Choose the primary display field
Open Primary Display Field and pick the field whose value names each linked record on forms and grids. It starts as the target's Name field.
Limit which records can be picked (optional)
Under Association Filters, open the filter builder and add conditions, such as Status is Active. Only matching records can be chosen when someone fills in the field.
Click Add
Click Add to create the field.
Settings reference
| Setting | What it does |
|---|---|
| Field Label | The name people see. Starts as the target entity's name. |
| Field Description | Help text shown with the field. |
| Allow linking to multiple records | Off: the field holds one linked record. On: it holds a list of linked records. |
| Two Way Binding | Creates a reverse field on the target entity and keeps both sides in sync. Turning it off, or deleting the field, unlinks the reverse field but does not delete it. |
| Applicant | Appears only when the target is your application's contacts entity. Marks this link as the record's applicant. Only one field per entity can be the applicant. |
| Lookup Fields | Fields of the linked record shown as columns for linked records in grids. Association, File, and Image fields cannot be lookup fields. |
| Primary Display Field | The field that names each linked record. |
| Association Filters | Conditions that limit which records can be picked. |
On the Configure page, an association field has a Go to associated entity link that opens the target entity.
How linked records display and behave
| Where | What people see |
|---|---|
| Record add and edit forms | A picker that lists the target's records by their Primary Display Field, limited by Association Filters |
| Forms built in the form builder | Linked records shown as Pills or Cards (set per form with Layout Type), with an option to let people create a new linked record from the form. See Required, Default, and Validation Rules. |
| Grid views | The linked record's display value, with the chosen lookup fields available as columns. Per view, you can also choose which linked fields staff may view or edit. |
| Record detail page | The linked records, which can be opened from there |
Deleting does not cascade
Deleting a record does not delete the records it is linked to. Deleting a Building Permit leaves its Contractor License in place. If you need linked records removed too, delete them separately.
Example
Link inspections to the permit they belong to, and show the permit's details on each inspection.
| Setting | Value |
|---|---|
| Entity being configured | Inspection Request |
| Target entity (Associated tab) | Building Permit |
| Field Label | Permit |
| Allow linking to multiple records | Off (each inspection belongs to one permit) |
| Two Way Binding | On (each permit lists its inspections) |
| Lookup Fields | Permit Type, Property, Status |
| Primary Display Field | Name (the permit number) |
| Association Filters | Status is any of Issued, Active |
Common mistakes
- Leaving the default label. A field named Building Permit on an inspection reads better as Permit; on a contractor's side, the reverse field can be renamed too.
- Turning on multiple linking by default. If a record should have exactly one parent, keep it off so people cannot attach two.
- Skipping the primary display field. If the display field is not distinctive, staff see a list of identical names in the picker.
- Expecting cascading deletes. Linked records are independent and stay when the other side is deleted.
- Creating the reverse link by hand. Use Two Way Binding instead of adding a second association field on the other entity, so both sides stay in sync.