Skip to main content
The INSERT formula is mainly used to insert data from the current entry Form into a target Table. For example, in vehicle management, you can insert vehicle information into a vehicle management system. Data in the current entry Form can come from either standard Components or subform Components. When the source is a subform Component, each detail row is inserted as a separate record into the target Table. Only one subform Component is allowed at a time.

Syntax

The syntax of the INSERT() function is as follows:
  • Target Table: the Form into which data is inserted.
  • Target Column: a Component in the target Table. INSERT only supports inserting data into standard Components in the target Table. Inserting data into subforms within the target Table is not supported.
  • Target Value:

Use Cases

The following two use cases help you better understand and apply the INSERT() function.

Case 1: Target Value Comes from a Standard Component

Scenario
  • Product Table: Product name, Stock quantity, Product category, Product category description
  • Product Category Table: Product category, Product category description
Requirement When a new record is added to the Product Table, insert the product category and category description from the Product Table as a new record into the Product Category Table.

Case 2: Target Value Comes from a Subform Component

If the target value contains a subform Component, the number of records inserted into the target Table equals the number of rows in the subform. Scenario
  • The current entry Form is the Purchase Table, which contains Purchase order number, Purchase date, and a Subform (containing Product name and Purchase quantity).
  • The target Table for insertion is the Inventory Table, which contains four Components: Purchase order number, Purchase date, Product name, and Purchase quantity.
Requirement When purchase data is submitted in the Purchase Table with N rows in the subform, N records must be inserted into the Inventory Table after submission.
  • Configure the INSERT function in the Business Association Rules of the Purchase Table as follows:
  • Set the target Table to Inventory Table, the target Column to Inventory Table.Product name, and the target value to the product name from the Subform under the Current Submitted Data Form.
  • The number of records inserted into the Inventory Table equals the number of products in the subform of the Purchase Table. For fields outside the subform, such as Purchase order number and Purchase date, the values are identical across every inserted record.

Notes

  • Differences between INSERT and UPSERT use cases
The INSERT formula inserts data regardless of whether the same record already exists in the target Table. In some cases, you may want to update existing records and only insert when the target record does not exist. For this scenario, use the Premium formula UPSERT.
  • The following Components are supported by Premium formulas.
  • Limits on the number of records that INSERT can insert.
  • Scenarios where the target value comes from multiple subform Components are not currently supported.
For example, if the target value comes from multiple subforms, where subform A has M rows and subform B has N rows, how many records should be inserted into the target Table? Would it be M*N records? If so, the data would be duplicated, resulting in statistical errors.