Drive Automation with Databases

Kasper Fehrend

Senior Product Evangelist at Leapwork

Learn how to use databases to drive an automation flow, as part of our series about data-driven automation with Leapwork.

In this tutorial, we dive into how we integrate databases into automation flows with Leapwork. We look at how to read, search and update data in databases directly from automation flows, still using the intuitive interface in Leapwork.




How Leapwork communicates with databases

There are a few things that are good to know when working with Databases and Leapwork:

  • The Database building block will connect and interact with the database.
  • Leapwork is using ODBC - Open Database Connection - to communicate with databases.
  • ODBC is a standard for communicating with databases that also defines a common database language that can be used to talk to any kind of database.
    So if your understand how to interact with databases in Leapwork, you now have access to all kinds of different databases. There are minor differences between the databases, but from a Leapwork automation design point-of-view the basic understanding is the same.
  • The way the ODBC connection handles the communication with different databases is based on a socalled the ODBC driver. 
    This driver is an interface to the database that translates ODBC commands - coming for example from Leapwork - into whatever query language the database uses.
  • The ODBC driver is a piece of software specific to the individual database types.
    It needs to be installed on the machines where the Leapwork automation flows will run. If a flow contains a Database block to read data from, for example a Microsoft SQL database, then the ODBC driver for Microsoft SQL Server needs to be installed on the machines where the flow should run. In most cases the installation is very easy to do, but it might require assistance from a database team, IT Support, or an operation department the first time you set it up. Be aware that Leapwork is released in both a 32 bit and a 64 bit version, so make sure that the ODBC driver matches this.
  • You need to make sure that there is an ODBC connection defined.
    The ODBC Connection is the configuration of how the ODBC driver should be used, and it contains information about what database to access, username and password, etc. There are several online instructions about installing ODBC drivers and setting up ODBC connections for any type of database, so we won't go the details here.


To sum up: In order to use the Database block, you need an ODBC driver installed and an ODBC connection defined.

The video tutorial above covers how database integration is done, what is needed to make it work, and how the Database block provides an easy and intuitive interface to the database. The tutorial shows how to use a database as the source for a data-driven automation flow and how to add parameters to an ODBC connection.


Go back to our overview of tutorials for 
data-driven automation.