Data Queries

Article • 04.08.2022 • 5 minute(s) to read

This page gives you short instructions on how to create, edit or delete Data Queries. Furthermore, it shows you how to work with Microsoft Word, Microsoft Excel and plain text templates as well as how to convert the resulting files to PDF.

Data Queries are SQL SELECT queries that extract Entities or other data form the Database. Depending on the configuration, the extracted Entities can be returned directly or inserted into a template to return a file.

More information on Data Queries is shown in this getting general reference.


Create a Data Query

  1. Navigate to the Data Queries by clicking on Administration > DATA > Data Queries
  2. Click on Create new query to create a new Data Query and open the Data Query Editor
  3. Design the Data Query in the Data Query Editor:
    • It is required to specify the unique identifier of the Data Query in the filed Name
    • Optionally, enter a descriptive text in Description
    • If your Data Query should not return the data directly, but instead convert the results to a file, you have to upload the template by clicking on Select file in the File template section:
    • Configure the access in the Permission section: When no permission are set, all Users can work with the Data Query. To limit the access to the Data Query, select the User Groups that should be allowed to use the Data Query.
  4. Write the SQL SELECT query specifying what the Data Query should retrieve from the Database
    • Define the parameters of the Data Query with a @ sign followed by an alphanumeric string., e.g., @MyParameter, @LowerBound, @SerialNumber., in the SQL SELECT query.
  5. Test the Data Query by clicking on Run query to open a test environment.
    • Specify the parameters, if the Data Query requires any.
    • Select if the Data Query should return the data directly or the generated file. Obviously, a template needs to be configured first, if the Data Query should return a file. However, even the Data Query is configured to return a file, it can return the raw data for better testing.
    • Press Run to test the Data Query
  6. You can finish the work on the Data Query by:
    • Discard your changes by clicking Cancel
    • Save changes by clicking Save & close
    • Or save changes by clicking on Save or Save as….

Edit a Data Query

  1. Navigate to the Data Queries by clicking on Administration > DATA > Data Queries
  2. Click on in row of the Data Query you want to modify and click on Edit
  3. You are now in the Data Query Editor. Here you can change any property or the SQL query of the Data Query:
    • Name or Description
    • Change the selection to Convert report to PDF? either to Yes or No
    • Add, remove or update the File template
    • Add, remove or update the Permissions configuration. When no Permission are set, all Users can work with the Data Query. To limit the access to the Data Query, select the User Groups that should be allowed to use the Data Query.
    • Change the SQL SELECT query specifying what the Data Query should retrieve from the Database
      • Add, edit or delete the parameters of the Data Query. The parameters are written with a @ sign followed by an alphanumeric string., i.g., @MyParameter, @LowerBound, @SerialNumber., in the SQL SELECT query.
  4. Test the modified Data Query by clicking on Run query to open a test environment.
    • Specify the parameters, if the Data Query requires any.
    • Select if the Data Query should return the data directly or the generated file. Obviously, a template needs to be configured first, if the Data Query should return a file. However, even the Data Query is configured to return a file, it can return the raw data for better testing.
    • Press Run to test the Data Query
  5. Once finished, you can:
    • Discard your changes by clicking Cancel
    • Save changes by clicking Save & close
    • Or save changes by clicking on Save or Save as….

Use templates to generates Microsoft Word, Microsoft Excel, PDF and plain text files

  1. Edit an existing Data Query or create a new Data Query
  2. Upload the template for the file generation by clicking on Select file in the File template section
  3. Select a file template and click on Open. Micosoft Word, Microsoft Excel and a pain text templates are supported
  4. Click on Upload
  5. To create a PDF file instead from the provided template, set Convert report to PDF? to Yes. If Convert report to PDF? is set to No, the generated file will have the same type as the template.
  6. You can finish the work on the Data Query by:
    • Discard your changes by clicking Cancel
    • Save changes by clicking Save & close
    • Or save changes by clicking on Save or Save as….

Delete a Data Query

  1. Navigate to the Data Queries by clicking on Administration > DATA > Data Queries
  2. Click on in row of the Data Query you want to delete
  3. Click Delete
  4. Confirm by clicking Yes, delete it!