Skip to main content

Control - Subform


What is a subform

When filling out a form, sometimes you enter multiple list types of data that have a variable number of rows, but all belong to the same type of business data. So a subform can be created to regulate its entry, which is a subform field, a subform of a worksheet.

Example:

  • Multiple working experiences of an employee (the main worksheet is "Employee" and the subform is "Work Experience").
  • A sales order includes multiple sales lists of items (the main worksheet is "Orders", and the subform is "Order Details").
  • Multiple reimbursement details for a single reimbursement order (the main worksheet is "Reimbursement", the subform is "Reimbursement Details").

Scenario: Create a subform of order details in the sales order worksheet

1. Add the subform field

Select the subform field from the left, and drag and drop it to the appropriate place.

2. Choose the way to add subforms

There are two ways, [Add from blank] and [Use an existing sheet as a subform].

  • Add from Blank: Create and design a new subform directly. This subform will not show up in the navigation bar in the application and can only be viewed and added through the main worksheet.

  • Use an existing sheet as a subform: Directly select an existing worksheet as a subform, which means that the subform has entity sheets.

First introduce the way to add subform from blank.

3. Add subform from blank

1). Add fields to the subform

2). Set the fields in the subform

  • Set the subform name

  • Adjust the field order

  • Delete fields in a subform

  • Modify the configuration of fields in a subform

  • Properties and validation methods for fields in the subform Click on the subform name to set the field's properties and validation method

3). Save and test

After designing the fields in the subform, add some data for testing.

4. Use an existing sheet as a subform

If you have already created a worksheet and its structure matches that of a child sheet, you can directly select it as a subform. By this way, you don't need to configure the fields in the subform, you only need to set the fields to be displayed.

Set the fields to be displayed in the subform

Since the fields are created and managed in the other worksheet, you cannot delete, rename fields, etc. You can only set which fields are displayed in the subform and the order of the fields.

In fact, if you convert a subform created from a blank to a worksheet, it is similar to select an existing worksheet as a subform.

5. Batch selection to add

When adding order details, the default is to add order details of each product one by one. In fact, you can batch select the product, and modify and improve it.

As shown in the figure below, check [Bulk selection to add].

Effect:

6. Read-only/Hide/Hide when create

Here the subform will be treated as a whole, if set read-only, all fields in the subform are read-only. If you need to set a field in the subform, you can change the configuration in the field details.

7. Operation of subform data

  • Create new items

    Sometimes, the details of the subform can only be filled in automatically through the workflow or default values, and cannot be added manually, then you can check this item. Users cannot add new details manually when adding or editing master records (there is no add button).

  • Edit existing items

    Sometimes the detail data cannot be manually modified after it is created, then this item can be checked. Users cannot activate the field for editing.

  • Delete existing items

    If checked, there is no delete button (details that have not been saved when added can be deleted).

    Note

  • Bulk deletion of data in the subform is not supported.

  • When you delete records in the main worksheet, the records in the subform will be deleted as well.

  • Data in subforms cannot be printed, shared, or created as tasks individually.

8. Sort data in subforms

By default the most recently added data is displayed at the bottom. You can set sorting rules for the data in the subform (you can only view existing records), and then display them according to the sorting rules after saving.

9. Adjust the column width of the subform

Open an existing record, drag and drop to adjust the column width, and save it.

10. Default values of subform

You can set default values for the fields, and automatically fill in the subform when you create a new record. Default values include static default values and dynamic default values (query worksheet).

1). Static default value

After setting the default value, every time you create a new record in the main worksheet, the subform will be automatically filled with the same data. For example, in the employee management worksheet, you need to add the employee's education experience, including elementary school, middle school, high school, and college. You can set four pieces of default data, and later you just need to change the date and name.

Set static default value

Effect

2). Dynamic default value

Dynamic default value is to get multiple data in a worksheet according to the set condition and fill it into the sub-sheet automatically.

Set dynamic default value:

Query Worksheet

11. Convert subforms to worksheets

After converting to a worksheet, it will be displayed in the left navigation bar in the application. A blank subform will not be displayed in the worksheet's navigation.

After converting to a worksheet, you can now perform separate statistical analysis of the data in the subforms. 

TIPS:

  • After converting the subform to entity worksheet, there is no association between the two.
  • After converting a sub-sheet to an entity worksheet, if you delete the sub-sheet field in the main worksheet (Expense Reimbursement), the sub-sheet (Detail) will not be deleted, and the data already added to the sub-sheet will not be deleted.
  • The conversion is irreversible.

12. Subform and Relationship

1). Conversion of subform and relationship

  • Click the [Change Type] button in the upper right corner, and the subform field (which has been converted to a worksheet) can be converted to a relationship field.

  • After converting to a related subform, add the reverse associated field of the main worksheet (Select[single row] by default (card)).

  • Similarly, relationship fields can be converted to subform fields.

2). The difference between [subform] and [Relationship] controls

Difference between subform and relationship 

13. How to get and add data of subform in bulk

Batch process data in subforms


Have questions about this article? Send us feedback