Skip to main content
Version: 2027 R1

MSSQL data source

A MSSQL database data source loads data based on a SQL query — run either through a previously defined connection to an external database, or directly against WEBCON's own internal database, with no separate connection required.

Overall view of the MSSQL data source configuration screen with the section tree on the left

The structure tree on the left lets you jump to each section: Basic, Personal data, Shared in applications, and Data source owners.

Basic​

Basic section — connection, SQL query, data source template, and test environment

The Basic section contains:

  • Data source type — the data source type, chosen once when the data source is first created (in this case MSSQL database). Once the data source exists, this field becomes read-only — its type cannot be changed afterwards.
  • Description — a free-text description entered by the user, making the data source easier to recognize in the data source list.
  • Connection — this field requires an explicit selection; it has no value set automatically by default.
  • SQL query — the SQL query text that returns the data source's data (details below).
  • Data source template — determines whether the source is a regular data source (Standard) or one prepared for use with leave data or the company structure, in which case the query must return specific columns (details below).
  • Test environment — the environment in which the query test runs when the Test button is clicked.
  • Test — runs the query and returns its result or an error message.

Connection​

List of available connections in the Connection field, including the built-in Current Webcon database option

The Connection field lets you choose which database the SQL query will run against:

  • <Current Webcon database> — a built-in option that runs the query directly against WEBCON's own internal database, with no separate connection to define.
  • any connection previously defined on the MSSQL connection page — the list includes every available connection.

SQL query​

The SQL query can run in several different contexts — for example, retrieving data, testing, retrieving the list of columns, or searching the data source from a choice attribute. To support these contexts, the query is wrapped in an additional subquery, and an ORDER BY clause (if present in the query) is moved outside that subquery.

This results in the following syntax constraints:

caution
  1. The query should return data in the form SELECT column1, column2, ... FROM table_name.
  2. Calling a stored procedure inside the query is not possible.
  3. Using the ROW_NUMBER() function is not possible.
  4. All columns must be named (e.g. SELECT column1, CAST(25.65 AS int) AS column2 FROM table_name).
  5. Using an ORDER BY clause requires referencing the defined column aliases (e.g. SELECT column1 AS Id, CAST(25.65 AS int) AS column2 FROM table_name ORDER BY Id).
  6. Using WITH query AS (SELECT column1, column2, ...) ... syntax is not possible.
  7. When an IF expression is used, the data will not be grouped or filtered.

For more complex queries, the recommended solution is to prepare a view or table-valued function and return the data in that form.

The fx icon in the top-right corner of the query field (Open the expression editor) opens a dedicated full-screen SQL query editor.

Full-screen SQL query editor with the testing bar expanded and the Functions panel

The right-hand side of the editor offers a Functions panel, letting you search for and insert dynamic values into the query — grouped into the Global business rules and Hyperlinks categories.

At the bottom of the editor, the Testing button expands a bar with the Element ID field and the Test and Preview buttons. It lets you check how the query behaves without leaving the editor. If the query is executed in the context of an element, enter that element's ID in the Element ID field — it is passed to the query during the test.

Data source template​

List of data source templates

Choosing a template other than Standard requires the query to return the columns defined for that template. Once such a template is selected, a help icon listing the required columns appears next to the field name. The Data source template field accepts one of seven values:

ValueMeaning
StandardA regular data source — the query does not have to return any specific columns
Vacation typeTypes of available leaves report
Vacations historyLeave history report
Available vacationsAvailable holiday leave report
Days offUser's days off report
Vacation plansPlanned leaves report
Business entities structureReport on users information and company structure

Required columns​

The tables below list the columns the query must return for each template — required columns are marked in the Required column. Dates are passed as numbers in the YYYYMMDD format (e.g. 20120123).

Vacation type​
ColumnTypeRequiredDescription
VACType_IDStringyesLeave type ID
VACType_ColorIDDecimalyesColor ID for type — a number from 1 to 6; the available colors are shown in the template's help
VACType_NameStringyesLeave type name
VACType_DescriptionStringnoDescription
VACType_TakeAvailableDaysBooleannoDefines if the planned leave decreases the number of available days off
Vacations history​
ColumnTypeRequiredDescription
VAC_UserIDStringyesUser ID
VAC_FromDecimalyesNumber that represents the leave start date
VAC_ToDecimalyesNumber that represents the leave end date
VAC_VACTypeIDStringyesLeave type ID (from the Vacation type data source template)
Available vacations​
ColumnTypeRequiredDescription
USR_UserIDStringyesUser ID
USR_CurrentYearDecimalyesNumber representing the year (e.g. 2012)
USR_DaysAvailableLastYearDecimalyesNumber of days off remaining from the previous year
USR_DaysAvailableCurYearDecimalyesEntitled number of days off available in the current year
USR_DaysUsedDecimalnoNumber of days off used in the current year. If the column is not defined, its value in the vacation summary is calculated based on leave submissions
USR_DaysAvailableDecimalnoCurrent number of days off available in the current year. If the column is not defined, its value in the vacation summary is calculated based on other columns
Days off​
ColumnTypeRequiredDescription
UFD_UserIDStringnoUser ID
UFD_DateDecimalyesNumber that represents the date
Vacation plans​
ColumnTypeRequiredDescription
PLN_UserIDStringyesUser ID
PLN_FromInt32yesNumber that represents the leave start date
PLN_ToInt32yesNumber that represents the leave end date
PLN_WFIDInt32noLeave plan ID
Business entities structure​
ColumnTypeRequiredDescription
CSTR_UserIDStringyesUser identifier. Values in this column must be unique
CSTR_LoginStringyesThe user's login (described as "BPS ID" in the template's help). Values in this column must be unique
CSTR_NameStringyesUser name
CSTR_SuperiorStringyesUnique superior identifier — a value from the CSTR_UserID column (null if the user does not have a superior)
CSTR_CompanyStringnoCompany name
CSTR_EmailStringnoEmail address

Personal data​

Personal data section with the Data source contains personal data switch

The Personal data section lets you designate the data source as a source of personal data for other processes (for example, a personal data dictionary):

  • Data source contains personal data — a switch that marks the current source as a source of personal data. The relation between the personal data dictionary and a process that uses it and stores copies of the data is configured additionally on every form field marked as containing personal data. Thanks to this, the system knows which dictionary element the field obtained its value from, and actions that delete or anonymize personal data can locate every place where data from a specific element was used.
  • Personal data identifier column — a field displayed once the switch is turned on, and required to complete the configuration. It lets you choose the column of the source that will serve as the unique identifier of a person. It is recommended that this column contains unique, numerical database identifiers.
info

To learn more about personal data, read the article available on the WEBCON Community website.

Shared in applications​

Sharing the data source with applications, and the Is public data source field

The Shared in applications section shows which applications currently use this data source. The Search applications field together with the Attach to application button lets you link the data source to another application; the Applications that can use this data source table lists the applications already linked to it, along with their status and an icon for detaching the link.

The Is public data source checkbox at the bottom of this section makes the data source available to every application in the system, so it can be used by processes running in any application — without having to link it to each one individually.

Data source owners​

Data source owners

The Data source owners field defines which users are allowed to edit the data source's configuration and share it with further applications. Other Designer Studio users — who are neither owners of the data source nor system administrators — can still use the data source in applications it's shared with, but cannot edit its configuration.