Child pages
  • Working with database fields in ConfiForms

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

If you are new to ConfiForms please take a look at less complicated tutorials first to get yourself familiar with ConfiForms

Creating a simple form in Confluence with ConfiForms

Multiple ways to show your form data in Confluence with ConfiForms

Basic concepts

 


Since version 1.20 of ConfiForms you are now able to source the data for your fields in ConfiForms directly from your databases. This requires your database to be accessible from your Confluence server and you need to provide the connection configuration, before you can use those fields. More on this below.

...

Warning

Important!

You query should return a list of data with AT LEAST 2 columns, where first column will be used as an ID and second column will be used as a label (other columns can be then used later in filtering, if necessary).

We strongly advice you to have a unique value for column ID

...

Some guidelines on using database fields in ConfiForms


Let's start with Database connection configuration, so ConfiForms will be able to use it. This configuration can be done only by Confluence administrators and usage can be restricted (you can setup which user group / user can use which connection)

...

Then navigating to ConfiForms add-on

 


And clicking on "Configure" button. You will be routed to the following URL: https://YOUR_SERVER/admin/vertuna/confiforms/config.action

Info

Alternatively, you can just start configuring your new form, adding new field definition of one of those DB types and clicking the "Configure NEW connection"

 


Configuration UI will be looking something like this:

...

Click on "Add new database connection configuration" button and you will be presented with a dialog to configure new connection

 


Give your connection a name, then compile a Connection URL, we use JDBC to connect to the database and you will need to provide correct JDBC connection string, class name for your database driver and you need to make sure the database driver is placed in the <install-dir>/lib directory of your Confluence server (restart will be needed). Confluence has PostgreSQL drive bundled together with the server, nothing additional is needed. For MySQL, Oracle, Microsoft SQL databases you will need to place the driver into the correct place.

...

Put the driver jar in <install-dir>/lib - this is the directory that has other tomcat jars. If you have a much older version of Confluence that does not have this directory, look for <install-dir>/common/lib instead. 


Here is the table of drivers and their connection strings we have compiled for our other plugin, ConfiDoc, but which is completely valid for ConfiForms

Info
titleList of connection strings for various drivers and databases

ConfiDoc Excerpt Macro
rootdiv id="db_drivers"
values8159330
serviceId54196d34-4e26-4e0b-801b-b565e28fc70f

 


You configuration for connecting to PostgreSQL will look something like this:

 


When it is saved, you will be able to use it in one of the DB fields:

...

In exports to Excel and CSV their labels will be used, for exports as JSON/XML we will export their internal ID's 


Info

Take a look at one demo configuration which shows you how to create "dependent" database dropdown fields Working with Dependent DB dropdowns

 

...