Skip to main content

Using Structured Filters

Learn how you can use structured filters to build complex queries

Updated today

Overview

Structured Filters in Kodexa provide a powerful query language for filtering documents and tasks. Using structured filter syntax, you can create complex queries to find exactly what you need across your Projects.

Enabling Structured Filters

To use structured filters:

  1. Navigate to the Documents or Tasks panel

  2. Look for the filter input field

  3. Toggle Structured Filter mode if available

  4. Enter your filter query using the syntax described below

Basic Syntax

Structured filters use a query language with fields, operators, and values:

field operator 'value'

Example Queries

  • status : 'active' - Find items with status "active"

  • name ~ '%report%' - Find items with "report" in the name

  • createdAt > '2024-01-01' - Find items created after January 1, 2024

Operators

Combine multiple conditions using logical operators:

AND Operator

Both conditions must be true:

status : 'active' AND createdAt > '2024-01-01'

OR Operator

At least one condition must be true:

status : 'active' OR status : 'pending'

NOT Operator

Negate a condition:

NOT status : 'archived'

Comparators

Compare field values using these operators:

Equality and Pattern Matching

  • : (Equals) - Exact match: status : 'active'

  • ~ (Like) - Pattern match with wildcards: name ~ '%invoice%'

  • !: (Not Equals) - Not equal to: status !: 'archived'

Numeric and Date Comparisons

  • > (Greater Than): amount > 1000

  • >= (Greater Than or Equal): amount >= 1000

  • < (Less Than): amount < 1000

  • <= (Less Than or Equal): amount <= 1000

Null Checks

  • IS NULL: assignee IS NULL

  • IS NOT NULL: assignee IS NOT NULL

List Membership

  • IN: status IN ('active', 'pending')

  • NOT IN: status NOT IN ('archived', 'deleted')

Pattern Matching with Wildcards

Use the ~ operator with wildcard characters:

  • % - Matches any sequence of characters

  • _ - Matches any single character

Examples

  • name ~ 'invoice%' - Starts with "invoice"

  • name ~ '%report%' - Contains "report"

  • name ~ '%2024' - Ends with "2024"

  • code ~ 'INV-____' - Matches "INV-" followed by 4 characters

Functions

Use functions for advanced filtering:

Date Functions

  • NOW() - Current date/time: createdAt > NOW()

  • DATE() - Parse date string: dueDate < DATE('2024-12-31')

String Functions

  • LOWER() - Convert to lowercase: LOWER(name) ~ '%invoice%'

  • UPPER() - Convert to uppercase: UPPER(status) : 'ACTIVE'

  • LENGTH() - String length: LENGTH(description) > 100

Aggregation Functions

  • COUNT() - Count items: COUNT(tasks) > 5

  • SUM() - Sum values: SUM(amount) > 1000

  • AVG() - Average value: AVG(score) > 80

Nested Queries

Query nested objects using dot notation:

assignee.id : 'user123'
assignee.name ~ '%Smith%'
status.label : 'In Progress'

Common Use Cases

Find My Tasks

assignee.id : 'YOUR_USER_ID'

Find Active Items From This Year

status : 'active' AND createdAt > '2024-01-01'

Find Unassigned Tasks

assignee IS NULL

Find Documents by Type

documentType IN ('invoice', 'receipt', 'contract')

Find Items Needing Attention

(status : 'pending' OR status : 'review') AND assignee.id : 'YOUR_USER_ID'

Find Recent High-Value Items

amount >= 10000 AND createdAt > NOW() - 30

Best Practices

  • Start Simple - Begin with basic queries and add complexity as needed

  • Use Parentheses - Group conditions for clarity: (A AND B) OR (C AND D)

  • Test Incrementally - Build complex queries step by step

  • Save Common Filters - Create quick filter options for frequently used queries

  • Consider Performance - Simpler queries execute faster on large datasets

Quick Filter Options

In addition to structured filters, Kodexa provides quick filter options:

  • My Tasks - Automatically filters to items assigned to you

  • Status Filters - Quick access to filter by task or document status

These quick filters use structured filter syntax internally and can be combined with custom filters.

Tips

  • Field names are case-sensitive

  • String values should be enclosed in single quotes

  • Date formats typically follow ISO 8601 (YYYY-MM-DD)

  • Use spaces around operators for readability

  • Complex queries can be saved as custom filter presets

Did this answer your question?