Data source question type

Applies to Infiniti v6.1.2 or later
 

Data Source

 
Data source questions provide a way of including stored data in your generated document. Data source questions retrieve records or rows from an external source such as a database table, view, stored procedure, XML data source, Web Service or other data system or line of business applications.
 
In some cases a data source may be called on to retrieve a single data row, while multiple data rows are needed for other situations. For more information about managing data sources, refer to Data Source Selection Types and Display Types.
 
The data source question allows a wide range of scenarios to connect to, join, filter and sort data in a variety of ways to populate generated documents, or to retrieve values for drop-downs or search in your web forms. For more information about managing data sources, refer to Data Filtering and Sorting.
 
Connections to data sources are managed in ‘Manage’. For more information about managing data sources, refer to Data Source Connection and Connection Types.
 
Often data records can be selected and consumed in a document without any user interaction. This is useful both for web form driven documents and for documents that are automatically generated without any user interaction.
 
Key fields defined in ‘Manage’ are used to filter and sort the data, which enables large data sets to be reduced to a more manageable and focused list. This can be used to join multiple data sets using primary/foreign key relationships.
 
Repeated Placeholders with Multi-Row Data Sources
 
Data can be used to drive a repeated placeholder, which copies down a block of the document or set of table rows for each data row returned by the data source. For each data row, the repeated placeholder and all its contents are copied down and populated by each data field answer added to the data source question.
 
It’s also possible to nest child data within a parent multi-row data source, and have the child also repeat its own placeholder within the parent block. A good example of this is presenting a list of classes each with its own list of students.
 

 

Document Preparation and Bookmarking

For single record data sources, insertion or selection placeholders can be used throughout the document to specify where the record’s data fields are to be inserted. For example:

When using a multi-row data source, insertion or selection placeholders are once again used to specify where the individual data fields of each record are to be inserted. Additionally, a repeat placeholder must be created to specify which block of document content to repeat for each data row that is retrieved. The repeat placeholder can surround one or more table rows, one or more paragraphs or even span pages. For example:

 

Placeholder surrounding a table row.

 

Usage

How to add a data source question

1.    From the toolbox, drag and drop a data source question onto a page, section column or tab and set the question’s properties as below.

Property

Description / Examples

Visible

Determines whether the records retrieved from the data source are displayed to the end user in ‘Produce’ for selection, or included in the document without user interaction. Check or uncheck as needed.

Mandatory

Determines if the data source must require an answer.

Default Index

The integer value of the default row or record. For example, set to 1 to default to the first data row. Leave blank or set to 0 to default to no data row selected.

Note that by default, invisible data sources will default to the first data row, but visible data sources will default to no selected row.

Selection Type

Determines if the question is to retrieve a single or multiple rows form the data source.

Display Type

For visible data sources, this property determines how the data question is to be displayed in ‘Produce’. The options are:

  • Drop-down List: For single row data sources only, this presents the data in a drop-down list.
  • List Box: For multiple row data sources only, this presents the data in a list with checkboxes for multiple item selection.
  • Search: Presents a search interface with search fields available based on specially marked key fields, as set up in ‘Manage’.
  • Pop-up Window: Presents a search interface as above in a separate pop-up window useful for using within smaller question areas such as columns.
  • Auto Complete: Provides a list of data which contains the letter or word that has been entered into the text box from which the required entity can be selected

Data Source

Select a data source name from the drop-down list. Data sources are managed in ‘Manage’.

Table/View

Select a table, view or other data object type available for the selected data source.

Display Field

Defines which field to display to the end user when using a drop-down list.

Value Field

Defines which field to use to identify the selected record. This should be set to a field containing unique values, such as a primary key, e.g. ‘ClientID’.

Repeating

Multiple rows selection type only. An area of the document that will be repeated for each record that is retrieved from the data source.

 

Questions that are not visible to the end user in ‘Produce’ generally require a data filter to ensure that only the correct record is included in the document
 

 

2. Infiniti automatically adds an answer to the new question. Set the answer’s properties as below.

Property

Description / Examples

Data field.

The data field or column of the table, view, query or method to retrieve from the data source. Select a data field, or one of the special types as follows:

  • [Formula]: A calculation to perform on the row, e.g. ‘[AnnualPremium]/12’.
  • [Aggregate]: Multiple records selection type only. A calculation to perform on multiple records, e.g. ‘Contains([q1], "Test")’.
  • [RowCount]: The total number of records retrieved.
  • [RowNumber]: The index of the current record.

Data Convert

Allows you to manipulate the data retrieved into a useable format. The following conversion options are available:

  • Date: converts a field into a date for calculations or formatting, based on the Pattern provided. See Pattern below for more information.

e.g. convert ‘20200101’ to ‘Wednesday 1 January 2020’.

  • Number: converts a field into a number.

e.g. convert the text ‘1’ to the number 1.

  • Image: converts a field into an image, if it is stored as binary data in the field or as a filename or UNC path reference.

e.g. convert the filename ‘c:\temp\img.jpg’ into an embedded image.

  • Text: converts a field into a text format. As all conversions trim any leading or trailing white space characters from the data, this conversion is useful for trimming string data before use.

e.g. convert the fixed width ID field ‘9060••••••••••     ••••••••••’ to the trimmed text ‘9060’.

  • Html/Rich Text: converts a field with html tags into a text with the tag properties applied to it
  • e.g. convert the text 'Example for <b>Bold</b>' to 'Example for Bold'

Pattern

Date data convert only. The pattern in which a date/time value is retrieved from the data source using date and time components similar to format strings.

For example, a date stored as ‘20113101’ can be matched with a pattern of ‘yyyyddMM’. Similarly, a time stored as ‘1801’ can be matched with a pattern of ‘HHmm’.

Refer to Format strings for a reference of component syntax to build your patterns.

Max Height/Width

Image data convert only. Specify the maximum height and width for the image.

Units

Image data convert only. Specify the units in which the max height and width are specified.

Stretch to Fit

Image data convert only. Stretches the image to exactly fit the size specified by max height and width. Note that images are always proportional within the boundaries specified.

 

3.    From the Placeholders tab, drag and drop any placeholders onto the answer that are to be populated by the data field.


4.    Add additional answers for each data field required, repeating steps 2 and 3.

      

Data Source Validation

To ensure the quality of retrieved data, Infiniti enables you to apply validation rules to data source questions. If a data field fails validation, Infiniti will display an error messag

Often Data Source validation is used in automatic or bulk generation scenarios where data is passed by a third party system for document generation without user interaction

 

Data validation rules are applied in the same manner as text field validation; for more information see Text Field Question Type.

 

Related Articles

Data Source Selection Types and Display Types
Text Field Question Type
Data Filtering and Sorting
Data Source Connection and Connection Types
Format strings

 

Keywords

data source question type stored data selection datasource connection format string dataobject