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
  • Creating a new Query
  • All Tasks Query
  • My Tasks Query
  • Due Today Query
  • Completed Tasks

Was this helpful?

  1. Overview
  2. Getting Started

Creating Queries

Creating queries to retrieve to dos from our database using the Query Desinger

PreviousSetting RightsNextBuilding The Layout

Last updated 4 years ago

Was this helpful?

In this section, we will create different queries to retrieve specific tasks from the database, namely :

For in-depth documentation about Queries, you can check out the corresponding documentation page :

Creating a new Query

To create a new query, click on Query then click on New Query

All Tasks Query

For this query, we simply want to retrieve all todos. We also give access to the Viewer group to run this query and access to the Editor group to modify this query.

In the Common Tab :

In the Fields Tab we can select which fields we want the query to return. For this tutorial, we will retrieve all the fields. Check the All checkbox on the right and click on Add Fields. This will populate our query with all the available fields in our To Do class.

In the Fields Tab :

When done, click the Save button to save the query.

My Tasks Query

This query will only return tasks of which we are the owner and make use of Conditions.

In the Common Tab :

In the Fields Tab :

Now we want to compare our user ID to the Owner field of the To Do class to determine if it should be retrieved or not. To add a new condition to our query, switch to the Conditions Tab, and click Add Condition.

Due Today Query

We want this query to return all to incomplete task due today. This means that we will once again make use of conditions to check both the IsCompleted and the DueDate fields of our To Do class.

In the Common Tab :

In the Fields Tab :

In the Conditions Tab, we click on Add Condition. Our first condition we want to check is MyToDos.IsCompleted = 0.

We now want to check if the due date is less or equal to today's date, which is denoted by MyToDos.DueDate <= {DateTime.Now.Date}.

To add a second condition, click on Add Condition and make sure to choose AND as the first connector Set the Field column to the MyToDos.DueDate field of your class set the middle Operator to <=.

Completed Tasks

For this last query we simply want to return completed queries.

In the Common Tab :

In the Fields Tab :

In the Conditions Tab, we click on Add Condition set the condition to MyToDos.IsCompleted = 1

We also want to sort the results of this query by having the latest task created first, so we sort the CreatedOn field in descending order by clicking on the Order By Descending Button.

On the right-hand side, choose the Owner field of your class. Click on the gear icon to open the Condition Properties window. Set Compare To to Expression and Value to {CurrentUser.ID}

Click on the gear icon to open the Condition Properties window. Set Compare To to Expression and Value to {DateTime.Now.Date}

⚙️
⚙️
Query Data
All Tasks
My Tasks
Tasks Due Today
Completed Tasks
Creating a new query
All Tasks Query Properties
My Tasks Query Properties
My Task Query Condition Properties
Due Today Query Properties
Due Today Condition Properties
Completed Tasks Quey Properties
Completed Tasks Conditions Properties