Skip to main content

Control - Relationship


In an application, each worksheet stores data of different business objects, and there are often relationships between these business objects. By setting the relationships between worksheets properly, not only can data redundancy be reduced, but also rapid data querying and displaying can be achieved.

Taking the customer and contact worksheets as an example, these two worksheets store detailed information of customer companies and contacts respectively. In actual business scenarios, for a customer company, there are usually multiple contacts; and a contact may be an individual, or may belong to a company. Without setting relationships, we may face the problem of duplicate data entry.

By setting relationships between worksheets, we can effectively solve these problems. Specifically, when creating a contact record, we only need to choose the existing customer record related to the contact worksheet through the relationship control, without having to enter the detailed information of the customer again. This not only avoids redundant data entry, but also ensures the accuracy and consistency of data.

At the same time, setting relationships between worksheets also provides us with the ability to quickly view related records. When viewing a contact record, we can quickly view detailed information of the customer company to which the contact belongs through the relationship field. This ability for quick location and data display not only improves our work efficiency, but also makes the relationships between records clearer and more intuitive.

Example

  • Relate multiple records

  • Relate one record

Field Configuration

In application development, field configuration is a key step in establishing data relationships. Through proper field configuration, data linkage between different worksheets can be achieved, improving data management efficiency and accuracy.

Use Case: In order to better manage customer information and its related contacts, we need to establish a relationship between the customer worksheet and the contact worksheet. The following are the specific steps:

1. Add a relationship control

Firstly, add a relationship control in the customer worksheet. This control will serve as a bridge connecting the two worksheets, allowing us to directly view contact information related to each customer in the customer worksheet.

2. Relate to the target worksheet

Next, we need to choose which worksheet to relate the current worksheet to. In the pop-up selection box, choose the contact worksheet within this application. Furthermore, the system also supports selecting worksheets from other applications for relationship.

It is important to note that if you want to relate to worksheets from other applications, you need to have the permissions as an administrator or developer in the target application to make the selection.

Bi-directional relationship

Using the customer and contact worksheets as examples, let's explain the concept of bi-directional relationships. In a customer record, it is necessary to relate contact information to have a comprehensive understanding of the customer's communication channels. Similarly, a contact record also needs to be related to the specific customer it belongs to, to trace the contact's business background and responsibilities. To achieve this kind of interconnection and data synchronization, we can use the relationship field to establish connections between the two worksheets, which is known as a bi-directional relationship. Through a bi-directional relationship, we can directly access detailed contact information when viewing customer records and quickly locate customer information when viewing contact records.

In the configuration of this relationship, the bi-directional arrows are typically represented in relationship fields, as shown below.

Uni-directional relationship

On the other hand, sometimes data in a worksheet serves only as a basic data source for records in other worksheets and does not need to be related to other worksheets. For example, a worksheet containing product information may be referenced by multiple sales or order records, but the product information itself does not need to know which sales or orders are related to it. In this case, we only need to set relationship fields in the sales or order records worksheet pointing to the product information worksheet, without setting a reverse relationship field in the product information worksheet. This type of relationship is referred to as a uni-directional relationship.

In the configuration of relationship fields, uni-directional relationships are typically represented by directional arrow pointing towards the data source worksheet being referenced.

3. Attributes of relationship field

Basic settings

Field name

Set the field name to display the contact records in this worksheet (customer worksheet). This name will be used to identify and display the related data.

By clicking on the blue worksheet name below the field name, you can directly access the form editing page of the related worksheet (contact worksheet), making it convenient for users to quickly access and edit related data.

Multiple rows: Allow relating one or multiple records.

Single row: Only allow relating up to 1 record.

Choosing the proper relationship quantity has a significant impact on data loading efficiency and data display. To optimize system performance and reduce data redundancy, it is recommended to choose relating a single record whenever possible, if it logically allows and meets the business requirements. This helps improve data consistency and query efficiency.

Introduction to three types of relationships

To displaying multiple related records

To meet diverse information display needs, we provide four ways to display multiple related records:

  • Card: Present the related records one by one in the form of cards, each card containing key information about the record, making it intuitive and easy to browse.

  • Dropdown menu: List the related records in a dropdown menu for users to select, suitable for scenarios where the number of related records is small and quick location or selection is needed. The dropdown menu is clear and user-friendly for quick decision-making.

  • Table: Clearly display detailed information of multiple related records in a table, allowing users to compare and select records easily.

  • Tabbed table: Place multiple related records in a tabbed table, allowing users to switch and view records from different relationship fields by clicking on tabs.

Note: If choosing to display in card or dropdown format, due to system performance and user experience considerations, it supports a maximum of 50 related records. If choosing to display in table or tabbed table, there is no limit to the number of related records.

To displaying single related record

We provide two ways to display multiple related records:

  • Card: Present the related records one by one in the form of cards, each card containing key information about the record, making it intuitive and easy to browse.
  • Dropdown menu: List the related records in a dropdown menu for users to select, suitable for scenarios where the number of related records is small and quick location or selection is needed. The dropdown menu is clear and user-friendly for quick decision-making.

E: Display Fields

You can choose which fields in the related worksheet are displayed.

  • List: Multiple columns

  • Card: Up to 3 columns

  • Drop-down box: Fields can be displayed when selecting records, and only the title field can be displayed after selecting.

F: Cover

  • An attachment to the related record can be displayed in the record card, but it must be a file or image that can be previewed.
  • If you select drop-down box or list, the cover can be displayed on Mobile Terminal, but not on PC.

Effect:

G: Default Value

There are three ways to set the default value.

  • Fixed value: Each time you create a record, it is related to the fixed records.

  • Other field values: Automatically reference the records related to other related fields.

  • Query worksheet: Get related records by querying the worksheet and automatically relate them.

    More details about default values

H: Set Associated Records

The following figure shows the page to add related records.

Allow selection of existing records:

  • If checked, you can select existing records directly from the worksheet Contact to relate. When associating the existing records, you can set filtering criteria to select from the filtered records. How to filter records

  • If it is not checked, the button of [Associate Existing Records] will be hidden. You cannot select existing records from Contact.

Allow to cancel existing association:

For records that are already related, you can check [Allow to cancel existing association]. If it is unchecked, the button will be hidden.

Allow to view records:

If it is not checked, then you cannot open the detail page of the related record. If you choose to display related records in multiple lists, quick edit is not available.

I: Query Settings

When associating records, you can search or filter the target record.

  • Search

    You can only search one field, checking [Fuzzy search] or [Accurate search].

  • Filter

    You can add multiple filter fields.

J: Associate View

If you choose to relate a view, when you add a related record, only the records in the view are displayed. The sorting of related records is also based on the sorting in the view, and opening the record in this case, there will show the custom actions and hidden fields in this view on the details page.

Note that even if the related record has changed and is no longer in the selected view, the association still exists.

K: View by User Permissions

If checked, the records and fields that are visible to the user are displayed based on the permissions the user is configured with.

  • If there are records that are not visible to the user, there is “X records are hidden”.
  • If there is a field that is not visible to the user, the field is grayed out and blank.

The following are other property settings

L: Bi-directional Association

A worksheet that stores basic data may be related to several other worksheets. But it is not necessary to show the associations with other worksheets in the basic worksheet.

For example, Customer is related to Contact, which is a one-way association by default. In this case there are no related fields to be automatically displayed in Contact.

Therefore, if you need to display the related fields in Contact, you can check [Bi-directional association] and set further.

In Contact, only 1 record in Customer can be related, so select [Single row] here.

Cancel Bi-directional Association: You cannot cancel the bi-directional association directly in the current worksheet. If you do not want to display this worksheet in the related worksheet, go to the configuration page of the related worksheet and delete the corresponding related fields.

M: Restrict Mobile Input

  • Disable manual input

    If checked, you can only add the related record by scanning the code on Mobile Terminal, and cannot add manually on PC or Mobile Terminal.

  • Disable the photo album

    If checked, you can only take photos and upload them.

  • Get input before displaying the form

    If checked, when adding a new record in APP, you need to take a picture and upload it first, and then fill in the other fields.

  • Submit the form directly after obtaining

    If checked, when adding a new record in APP, the record is automatically submitted once the photo is taken and uploaded.

Create: Create a record in the related worksheet and automatically relate it with the current record

Select: Select an existing record from the related worksheet

Only the relationship between two records is deleted, not the records.

6. Adjust Column Width

On the record details page, drag and drop to adjust the column width and save it. If Admin adjusts it, it will be updated on everyone’s page.

7. Column Display

It is possible to display the fields in this record and the related fields in two separate areas. You need to select [Multiple row] and choose to display in a list when associating records.


Have questions about this article? Send us feedback