Docs
  • Getting Started
  • Overview
    • Understanding
      • User-Interface
      • Shortcuts
    • Getting Started
      • Creating A New Application
      • Adding Basic Structure using Class Designer
      • Creating a link to the TIVITY File Class
      • Setting Rights
      • Creating Queries
      • Building The Layout
        • Creating an App Page
        • Creating an Object Page
        • Creating a List Item Layout
  • Building an Application
    • Application Setup
      • General
      • Documentation
      • License Management
      • Publishing the Application
      • Advanced Settings
        • Document-MailEditor
    • Data
      • Sources
      • Data Modelling
        • Class
        • Field
        • Action
        • Link
      • Query Data
        • Get Started with Query Designer
        • Common
        • Fields
        • Conditions
        • Default Values
        • Preview
      • Roles & Permissions
        • Rights Designer
      • Access Control Lists (ACL)
    • Views
      • Design UI
        • Page Types
        • Fields and Links
        • Layout Controls
          • Actions
          • Panels
          • Sections
          • Lists
          • Input
        • Layout Templates
      • Document Templates
        • Get started with Template Designer
        • Expressions in Templates
    • Execution
      • Functions
      • Workflows
        • Control Types
      • Trigger
      • Scripting
        • Accessing the Script Designer
        • Using the Script Designer
        • Commonly used Actions
        • Reference: Actions
          • Math
          • System
          • Date
          • Collection
          • LogicalOperators
          • Web
          • Structure
          • Constants
          • Converters
          • Commands
          • Text
          • PDF
          • Operators
          • PowerPoint
          • QR-/Barcode
          • Messaging
          • Cells
          • Xml
          • Admin
          • Integrations
    • Expressions
      • Expressions in Expressions
      • Expressions in Condition Values
  • Administration
    • Platform
    • Workspace
    • Security
    • Platform Setup
  • Extensibility and Integration
    • REST API
    • Source Adapter
      • Getting Started
      • Source Adapter Interface
      • RESTful Adapter Service
  • Adapter Portfolio
    • MongoDB Adapter
  • Platform Features
    • Enterprise Search
      • Integration into an App
      • General Settings
    • Templates
    • Tagging
      • Getting Started
      • Manage Tags
      • Settings
      • Usage
        • Tag filter
        • Tag panel
    • DMS Setup
Powered by GitBook
On this page
  • Overview
  • Key
  • Source
  • Query Context
  • One-to-Many relationship
  • Run Credential
  • Edit Credential
  • Invisible for users
  • Use as report
  • Name
  • Pre-Script Configuration

Was this helpful?

  1. Building an Application
  2. Data
  3. Query Data

Common

Query Designer is divided into several sections - Common, Fields, Conditions, Default Values and Preview. This article provides detailed information about the Common section.

PreviousGet Started with Query DesignerNextFields

Last updated 2 years ago

Was this helpful?

Overview

The Common section contains general properties of a query. In this section you can specify the name of the query as shown on the list of queries, the data context from which the query retrieves any information needed, and the credentials which are necessary to edit and run the query in your app. Here you would also specify whether the query is visible to other users or bound to reporting.

Key

Optionally, you can give your query a Key or match code. This property can be helpful in other drop-down or selection menus in your app to quickly access and choose a query. In the list of queries the value of Key is shown in parentheses behind the name of the query.

The Key is a unique distinction between queries which is displayed in the Query Designer, but will not be visible to the end user in the finished app

Source

The Source of a query specifies the data source or in our context the Class of an entity in the app.

The selection of a Source is compulsory in a query.

Query Context

The Query Context defines the relationship that applies to the Source of a query. It is needed in case that you want to retrieve data from a certain type of Class (as specified as Source) only.

A Query Context represents a grouping of records provided by the Source and is defined as a Class.

One-to-Many relationship

Commonly an app is based on more than one Class and there are relationships between those classes. An often used approach is the representation of data in a one-to-many relationship, e.g. a ToDo entry (Class) can have many Documents (Class) allocated to it. Or otherwise a document is connected to a ToDo entry.

A document however does not necessarily have to be assigned to a ToDo record but could either be linked to another Class, e.g. a Reminder, or could be stored in the app as standalone.

By providing a Query Context of class ToDo in your query the result will show data from documents that are associated to a ToDo entry only. Other records of class document will be ignored.

Run Credential

Launching a query and seeing the result in your app requires permissions. The Run Credential provides access to either a group of users or a single user in your app.

Usually the choice of the Run Credential would be an entry with low permissions, e.g. a viewer account or group, only.

The selection of Run Credential is compulsory for a query. You should consider the principle of least privileges to assign to your users in order to access and run a query.

Edit Credential

Permissions to edit a query are separate from the ability to see the result. The Edit Credential grants permissions to either a group of users or an individual user in your app to modify a query.

The selection of your Edit Credential would be a role of an editor with slightly more permissions than a viewer but not as much as an administrator.

The choice of Edit Credential is compulsory for a query.

Invisible for users

An invisible query can still be used in other areas of the app, e.g. the Layout Designer.

Use as report

If the checkbox Use as report is selected the query is automatically available in the Reporting App and displayed in the section called Reports provided by Apps.

Name

The common Name as well as a Description of a query can be given in multiple languages. The localised information is displayed in compliance with the accepted language in the web browser of a user.

Pre-Script Configuration

Pre-Script Configuration gives you the possibility to write a script, within which you can set values for the purpose of using them in the 'Conditions' tab of the designer. This enables you to use these values for condition(s) before the execution of the query.

Each condition value with the expression format {Parameter.} will be replaced by a parameter value defined in the script (with the variable name ).

The context of the script is passed to the script as well:

  • Context.ApplicationId (ID of the application the selection is executed in)

  • Context.ClassId (ID of the class of the selection or the selection is executed with)

  • Context.OfficeId (ID of the office the selection is executed in)

  • Query.ContextLinkId (the link ID from the context class to the source class of the selection)

  • Query.ContextInstanceId (ID of the instance of the selection context)

  • Query.ContextClassId (ID of the class used in the selection context)

Variables Query.ContextLinkId, Query.ContextInstanceId and Query.ContextClassId are only available if the Query Context for the Source has been set, as visible in the following sample image:

Currently supported languages are English, German and French.

Open the selection control by clicking on the icon and either scroll the list for an entry or type the name of the class in the Search field at the top of the selection to choose a Source for your query.

Open the selection control by clicking on the icon and either scroll the list for an entry or type the name of the class in the Search field at the top of the selection to choose a Query Context for your query.

Open the selection control by clicking on the icon and either scroll the list for an entry or type the name of the class in the Search field at the top of the selection to choose a Run Credential entry for your query. If there are multiple entries of the same name the app is shown as suffix in parenthesis.

Open the selection control by clicking on the icon and either scroll the list for an entry or type the name of the class in the Search field at the top of the selection to choose a Edit Credential entry for your query. If there are multiple entries of the same name the app is shown as suffix in parenthesis.

The checkbox Invisible for users allows you to hide queries while they are still in development and to remove a query from menus and selections available to the user directly. An invisible query is marked with a crossed-out eye icon in the list of Queries.

Common attributes and values of a query
One-to-many relationship based on primary/foreign keys in a relational database schema
Creating a new script within Pre-Script Configuration
Example of using a value of the Pre-Configuration script to set a condition
Script Context Variables
Sample Query Context