The OutSystems Platform PlatformRuntime API provides actions to:

To use this API, add a dependency to your application on the PlatformRuntime_API module.

Summary

Actions

DatabaseConnection_SetConnectionStringForSession

Switches a Database Connection from one database to another at runtime and in the current session.

Request_GetKey Action Provides the GUID that uniquely identifies the current request.

Actions

DatabaseConnection_SetConnectionStringForSession

This action switches a Database Connection from one database to another at runtime and in the current Session. Use it in integration scenarios where an application needs to access multiple external databases (e.g.: one per territory) with the exact same schema but different data, and the connection to the database depends on runtime criteria like the user login or application data.

There are some conditions to which you have to pay attention to when using this action:

Inputs

connectionName
Type: Text;
The name of the Database Connection, as defined in the development environment.
connectionString
Type: Text;
The Connection String to connect to the new database.
oracleInitialSchema
Type: Text, optional;
When connecting to an Oracle database, indicates the name of the schema to be initially used.

Request_GetKey Action

Provides the GUID that uniquely identifies the current request.

You can use this value to correlate the current request with the analytics data collected by OutSystems Platform. For instance, use the identifier that this method retrieves when capturing your custom request events through the PerformanceMonitoring API.

Output

RequestKey
Type: Text;
The GUID that uniquely identifies the current request.
If there is no Request Key available in the current context, an empty string is returned.

See Also

About APIs | Connect to an External Database