Skip to content

Data Sources

Data sources are employed to populate form controls with lists of values. These controls can include, but are not limited to, query and dropdown elements.

The nature of a data source can range from a simple list of values to complex database queries.

Data sources support extensible results. In addition to the basic Value and Text attributes, they may incorporate supplementary attributes depending on the specific data source type.

Each data source is equipped with TextFormat and ValueFormat properties, which facilitate the extraction of data from a result row. These properties are defined using the data templates format, enabling the combination of multiple values into a single value.

Example Data Source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<ListItemDataSource TextFormat="{{Id}} - {{Name}}" ValueFormat="{{Id}}">
    <Items>
        <Item>
            <Id>1</Id>
            <Name>A</Name>
        </Item>
        <Item>
            <Id>2</Id>
            <Name>B</Name>
        </Item>
    </Items>
</ListItemDataSource>

In this example, the data source provides a list of items that will render as 1 - A and 2 - B when used within a dropdown control.

Mappings

Data sources can include mappings that define how the data source's results are utilized within a form. These mappings are specified within the <Mappings> element and facilitate the association of data source results with form controls.

The following example illustrates how to map the Amount property from a data source to a form control:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<ListItemDataSource TextFormat="{{Id}} - {{Name}}" ValueFormat="{{Id}}">
    <Mappings>
        <Mapping Source="Amount" Target="Amount"/>
    </Mappings>
    <Items>
        <Item>
            <Id>1</Id>
            <Name>A</Name>
            <Amount>3</Amount>
        </Item>
        <Item>
            <Id>2</Id>
            <Name>B</Name>
            <Amount>8</Amount>
        </Item>
    </Items>
</ListItemDataSource>

In this configuration, the Amount property from the selected data source item will be mapped to Amount named a data model element as target. When an item from the data source is selected, the value of its Amount property will be automatically assigned to the target form control.

The following data source types are supported:

Simple Data Sources

These data sources are static and do not require any external data source.

ListItemDataSource

This data source returns a static list of values.

System Integration Data Sources

These data sources are used to retrieve definitions from the Emakin system, thus facilitating integration.

ChannelDataSource

This data source returns a list of available team channels, which can be useful for allowing users to select a channel for specific cases.

SecurityProfileDataSource

This data source returns a list of available security profiles, enabling the selection of an Access Control List (ACL) security profile for assigning ACLs to entities such as documents.

ScheduleDataSource

This data source returns a list of available schedules, which can be used to select a calendar schedule for time-based operations.

ContentTypeDataSource

This data source returns a list of available content types, which can be used for dynamically rendering a content type.

Dynamic Data Sources

Dynamic data sources are employed to fetch data from external sources dynamically. The fetched data may vary based on query parameters or other conditions.

TableDataSource

This data source executes a relational database query and returns the result as a list of values.

XmlQueryDataSource

This data source executes an XQuery expression on an XML database and returns the result as a list of values.

XmlDataSource

This data source executes an XPath expression on the current data model and returns the result as a list of values.

ScriptDataSource

This data source executes a script and returns the result as a list of values.

WebServiceDataSource

This data source executes a web service call and returns the result as a list of values.