Skip to main content

Control - Query Records


The Query Records control allows users to quickly retrieve data from other worksheets (or aggregate tables) related to the current record while viewing it.

Use Cases

  • In customer management application, if the Order worksheet is related to the Customer worksheet (not bi-relationship), users can use the Query Records control in the Customer worksheet to view all orders related to the current customer.

  • In HR Management application, in an employee information worksheet, users can utilize the Query Records field to access an employee's files and attendance records (even if the Employee worksheet is not directly related to the Attendance worksheet).

Field Configuration

Use Case: As shown below, the Order worksheet is related to the Customer worksheet (a one-way relationship, meaning the Customer worksheet is not related to the Order worksheet). Now, we want to enable users to view all orders related to a specific customer directly in the Customer worksheet using the Query Records control.

Add a Query Records control

In the Customer worksheet, add a Query Records control.

Select the worksheet/aggregate table to query

Here, we select the Order worksheet to query.

Configure query method and conditions

There are two ways to configure query conditions: Create Query and Existing Relationship.

  • Create query: Configure query conditions from scratch.

  • Existing relationship: Select an existing worksheet relationship and then refine the query conditions.

What happens when dynamic values used in query conditions are empty?

Create query

For example, to query the approved orders of the current customer, select the Order worksheet to query, then click Next to configure query conditions.

Configure Query Conditions:

  • Condition 1: The related "Customer" field in the order record is any of the current record.

  • Condition 2: The "Status" is "Approved".

Click Confirm to complete the condition setup.

Note: Since the Order worksheet is already related to the Customer worksheet, the system will prompt whether to use the existing relationship to configure query conditions when selecting the Order worksheet.

After selecting the worksheet relationship and clicking Next, the system will automatically create a query condition involving the relationship field. Users can further refine conditions as needed.

Existing relationship

Use an existing worksheet relationship to quickly create query conditions. Select the worksheet relationship of the current worksheet, then click Next.

The system will automatically add a query condition (e.g., "The related Customer is any of the current record"). Additional conditions can be added as required.

More Settings

After configuring the query conditions, you can set more features for better performance.

Sort

The queried records will be displayed according to the sorting rules configured here.

Display single record

If "Single record" is selected, the first record from the queried results (based on the sorting rules) will be shown. You can specify which fields to display, and all fields will be presented in card.

Display multiple records

Number of records to query

You can set the number of records to be queried. For example, if you only want to query and display one record or consistently show the top 5 records.

If this setting is not configured, all matching records will be queried.

Display mode

There are four primary ways to display the queried records in the current record:

  • Text (Default mode, displays up to 50 records)

  • Card

  • Table (Can be placed anywhere on the page or within tabs)

  • Tab table (Displayed at the bottom of the page, aligned with tab fields)

To demonstrate these four display modes, we created four query record fields for comparison:

Allow adding record

If enabled, an "Create Record" button will be displayed, allowing users to directly create records.

Allow opening record

If enabled, clicking a record will open its details. You can select a specific view to display the record based on the view's configuration.

Allow export

If enabled, users can export the visible queried records to Excel (up to 10,000 records maximum).

Table settings

Table settings are only available for the Table and Tab table display modes.

Show by user permissions

If disabled, all records matching the query conditions will be displayed. If enabled, only records that the current user has permission to view (as configured in the Order worksheet's permission settings) will appear in the query results.

Additional notes on Query Records

  • Queried records are for display only and do not store data.

  • Filtering and sorting are not supported.

  • Query records cannot be used as conditions or dynamic values.

  • In business rules and workflows, you can configure query records to be shown, hidden, or set to read-only.

Differences Between Query Records Field, Relationship Field, and Bidirectional Relationship

  • Query Records Field

    • Dynamically queries and displays results in real-time based on conditions.

    • Does not store data.

  • Relationship Field

    • Requires selecting records from the target worksheet.

    • Saves the relationship between records.

  • Bidirectional Relationship

    • Requires adding relationship fields in both worksheets to enable two-way data synchronization.
  • Example (Sales Management Application):

    • When creating an order record, you need to select a customer → Use a relationship field.

    • When viewing a customer record, you need to query all related orders → Use a query records field.

    • When managing sales representatives and teams: Sales rep records must be related to teams. Team records must also display related sales reps. In this case, a bidirectional relationship ensures automatic two-way data sync.

  • If one worksheet in a bidirectional relationship contains excessively large data, you can:

    • Modify the setup to only allow relating records from one side.

    • Use a query records field on the other worksheet to retrieve results.

    This reduces the burden of two-way synchronization, improving worksheet performance.