Skip to end of banner
Go to start of banner

How to input data into a form and retrieve it from database

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Current »

This article explains how to input data through a form and retrieve results from a database using the Run Self-Service Reports for Confluence and SQL for Confluence apps.

Instructions

  1. Make sure that database connection is successful using the SQL for Confluence app.
    1. Log into your Confluence instance as Confluence administrator and navigate to (Cog wheel) > Manage apps
    2. From the left sidebar, select the SQL app > View and modify data source profiles and ensure that connection to database is successful.
  2. Insert SQL macro inside Run with a user form and parameters macro:
  3. Insert SQL statement as per your requirement. In the example below, we consider retrieving data from the table persons:

  4. Edit the Run with a user form and parameters and click Add my first field in Field settings:

  5. Select Field type and add Field key. Here the Field key is considered as per the SQL statement mentioned above (PersonID):

  6. To enter more than one field, click Add field:
  7. Save the macro settings and publish the page.

  8. Provide input and click Run. As per the above SQL statement and input data entered in the form, data is retrieved from the database:


Any text in the SQL macro body that begins with $ immediately followed by a Field key from Run with a user form and parameters macro will be replaced by the values provided in the form.

  • No labels