Toggle menu

Using External Datasources

External databases can be used to populate the Grouped Options of various fields in the iCM Forms Designer. This includes Radio Groups, Checkbox Groups, Drop-down Lists and List Boxes.

Group Options

The FormUtils Worker also provides various methods for interacting with external databases, including reading data and executing SQL statements.

Defining Datasources in the API Server Configuration

Any number of datasources can be defined in the configuration that is sent to the API Server. The API Server configuration files are held in the iCM custom folder, generally available via iCM's file manager.

To add a datasource to the configuration, add an environmentConfig object at the same level as the workers array. For example:

"environmentConfig": {
    "dataBases": {
        "default": "icm",
        "dataSources": {        
            "mydatabase": {          
                "databaseDriverClass": "com.microsoft.jdbc.sqlserver.SQLServerDriver",
                "databaseUserName": "theusername",
                "databaseConnectionString": "jdbc:sqlserver://GI00645:1433;DATABASENAME=mydatabase;sendStringParametersAsUnicode=true;SelectMethod=direct",
                "databasePassword": "thepassword"        
            }      
        }    
    }  
}

This configuration will be merged with the standard configuration sent from iCM when you send it to the API Server. See the API Server and Worker Configuration article for more information.

Last modified on 15 May 2020

Share this page

Facebook icon Twitter icon email icon

Print

print icon