isDBConnectionAvailable
This function is used by Ignition's Expression language.
Description
note
This function is only available in Transaction Group Expression Items and Expression Tags.
Checks if the given database connection is available. Will use the default for that scope if none is specified.
Syntax
isDBConnectionAvailable([datasource])
Parameters
string datasource - Optional. The name of the database connection to check if available. If omitted, will return the default database connection for the nearest resource, based on where the function is being called from.
Common locations where the function can be called from:
- Somewhere on a tag(i.e., Expression Tags): The default database connection for the Tag Provider
- Somewhere in a project (i.e., Expression Binding): The default database connection for the Project.
Results
- Bool - True if the database connection is available, False if not.
Examples
Code Snippet
isDBConnectionAvailable("MySQLConnection") //would return true when the database connection was valid.