Skip to main content
Version: 2023 R3

Initialization

Configuration of the Item list initialization allows users to define values to be automatically entered in the Item list rows after opening the form. Additionally, it is possible to initialize columns which are not displayed on the form (their visibility is restricted or they are marked as technical columns).

Init_screen.png

1. Action mode

Selection of action mode from the following options:

  • Initialize only in the first step – initializes Item list on the first step only,
  • Initialize on ever step (without ending steps) – enables the Item list initialization also on other steps, except the finishing ones when the list has not been edited so far and there are no versions available from the previous steps in the history.

2. Initialization

There are two available initialization options:

  • Use data source or query – initializes the list with an SQL query that returns rows with which an Item list will be initialized or column mapping.
  • Use static initialization: – allows to define a fixed set of items with which the Item list will be initialized.
Static initialization

Using the + or - buttons you can add new items to an Item list. The ID value must be a number.

Init_custom.png

SQL query in the Use data source or query initialization

The query should follow the following format: "Select ‘text123’ as ‘DET_Att1’, ‘9’ as DET_Att2". In the case of this query the "text123" value is inserted in the "DET_Att1" column, and the form field with the ID of "9" is entered in the "DET_Att2" column.

The ID and the field corresponding to a given form field in the database can be viewed in the form field general configuration.

Init_custom_2.png

The Data source field allows users to select a data source that is different than the default one, and, consequently, sending a query to a source different than the content database. The query must return columns with names corresponding to the names of Item list columns in the database.

When a default source is selected, the query is executed with content database connection parameters.

info

When it is not necessary to link with an external data source, use the default one, as its modification affects the query execution efficiency.

An example of an SQL-based initialization

A demonstrative Item list (a list of products):

custom.png

Column nameType
NameSingle line of text
AmountFloating-point number
PriceFloating-point number
DescriptionMultiple lines of text
Ordered byChoice field (picker)

The SQL Products table is used as a data source:

Column name
ProductName
ProductPrice
ProductDescription
ProductCount
OrderedBy

The table has been created in the default data source, i.e. the content database.

An example of initialization configuration:

custom_2.png

The query automatically maps the data source columns and copies their values to the Item list columns, e.g. the ProductName column of the source table corresponds with the DET_Att1 Item list column. The database name of the Item list column is displayed in the Column field of column configuration window.

The configured initialization is executed only at the first step. The initialization result:

custom_3.png