(Example) Configure a Relationship in Data Entities

This topic gives an example of how to create relationship between the primary field and a custom field in another entity.

Background and Setup

Video: Build Your First Custom Entity

Prerequisites

Good to Know

  • For the use case in this example, a business wants to associate a person with an account. The Account Name field in the built-in Account entity is associated with a custom Account Name field in the built-in Person entity. If the Account Name is changed in the Account entity, the Account Name field is updated in the Person entity.
  • In the Data tab, the field for which you create a relationship shows the Lookup Data Lookup Data icon icon next to the field.

Step 1: Create a Relationship

Create a relationship between entities.

How to Start

  1. Click App Builder.

    Build Apps screen
  2. On the App Explorer screen, click Data Entities.

    Data Entities
  3. On the Data Entities Home screen, click Entities Entities icon.

    Entities
  4. On the Entities screen, click the Person entity.

    Person entity
  5. On the Person entity, click the Relationships tab.

    Relationship tab
  6. On the Relationships tab, click Add Relationship.

    Add Relationship

Procedure

  1. On the New Relationship screen, in the Name field, enter PersonAccountName.

    PersonAccountName
  2. In the Parent Entity field, select Account.

    Account
  3. In the Parent Primary Field select Account Name.

    Account Name
  4. In Child Field Display Name field, enter Account Name.

    Account Name
  5. In the Child Field Name field, enter AccountName.

    When you click Child Field Name field, this field completes the value from Child Field Display Name field.


    Child Field Display Name field
  6. Click Save.

    Save
    The Relationship tab shows the relation name PersonAccountName_r.

    PersonAccountName

Step 2 (Optional): Enter Data in the Parent Field to Update in the Child Field

Enter a record in the parent field in a relationship.

Good to Know

  • This step is not required to create the relationship. It shows how the relationship updates the data in the child field when data is entered in the parent field.

How to Start

  1. On the Entities screen, click the Account entity.

    Account entity
  2. On the Account entity, click the Data tab.

    Data tab
  3. On the Data tab, click Add Data

    Add Data

Procedure

  1. On the New Data screen, in the Account Name field, Enter Personal Bank Account.

    Personal Bank Account
  2. Click Save.

    Save

    The Data tab shows the data Personal Bank Account in the Account Name field.


    Personal Bank Account data
  3. On the Data Entities Home screen, click Entities Entities icon.

    Entities
  4. On the Entities screen, click the Person entity.

    Person entity
  5. On the Person entity, click the Data tab.

    Data tab
  6. On the Data tab, click Add Data.

    Add Data
  7. On the Add Data screen, click Lookup Data Lookup Data icon.

    Lookup Data
  8. On Select a Record screen, click Personal Bank Account.

    The data you entered in Account entity fields is shown in this screen.


    Personal Bank Account
  9. Click Select.

    Select
  10. The Account Name field shows Personal Bank Account.

    Personal Bank Account
  11. Click Save.

    Save

    The Data tab shows the Personal Bank Account in Account Name field.


    Personal Bank Account