Associating Entities

The section describes how to connect entities together using associations.

About this task

An association is the connection of two entity types through fields with common data. In Application Builder, these associations are created by adding association definitions to an entity. Each association is single direction connection from an entity. You can make an association bidirectional by creating the opposite association on the associated entity. Perform the following procedure to create an association:

Procedure

  1. Edit the entity that you want to add an association to by clicking Entities and then clicking the name of the entity that you want to edit.
  2. Scroll down to the associations section of the page, and, if necessary, click the plus sign (+) icon to the right of the associations table to create a new association row.
  3. Enter a name for the association into the Association name field. This name will be used in widgets when referencing the association.
  4. Next, select an originating field from this entity, the entity that you are associating this entity with, and the linked field of the associated entity.
    Tip: You can create multiple associations between two entities to achieve different sets of results. Additionally, you can create associations between the same entity. For example you could link managers to employees. The only requirement is for the associated fields to have data that can be matched.
  5. Scroll to the bottom of the widget editing form and click Save entity.

Results

Your entities are now associated. This association means that you can use the entity.association_name string, where association_name is the name of the association that you created. Or, you can use the subject.association_name string on the detail page of that entity to access associated entities in your widgets.

What to do next

After creating all the basic entity associations in your application, you might want to create some association chains. An association chain is an alias for associations that creates a link between entities that otherwise do not have linked fields. The options that are available when you create association chains can be found in the Association Chains section of the documentation.