Skip to main content

Prerequisites

  • A working sheet configuration with entity types and data sources
  • Familiarity with query predicates

Available Functions

Powersheet supports the following function expressions in query where clauses:
FunctionArgumentsReturn TypeDescription
toupperstringStringConverts value to uppercase
tolowerstringStringConverts value to lowercase
trimstringStringRemoves leading/trailing whitespace
concatstring, stringStringJoins two strings together
substringstring, start, lengthStringExtracts a portion of a string
replacestring, stringStringReplaces substring occurrences
lengthstringInt32Returns character count
indexofstring, stringInt32Finds position of substring
yearDateTimeInt32Extracts year from date
monthDateTimeInt32Extracts month (1-12) from date

Step 1: Use String Functions in Where Clauses

To filter entities with case-insensitive matching, use tolower or toupper on string properties in your query configuration:
{
  "where": {
    "tolower(title)": { "contains": "safety" }
  }
}
This matches work items whose title contains “safety” regardless of casing (e.g., “Safety Analysis”, “SAFETY REVIEW”).

Step 2: Use Trim for Clean Comparisons

When data may contain leading or trailing whitespace, use trim to normalize values:
{
  "where": {
    "trim(status)": { "eq": "approved" }
  }
}
You can chain function expressions for robust matching. For example, use tolower(trim(title)) to both trim whitespace and normalize case before comparison.

Step 3: Use Date Functions for Time-Based Filtering

Extract date components to filter by year or month:
{
  "where": {
    "year(updated)": { "eq": 2026 }
  }
}
To filter for a specific month:
{
  "where": {
    "month(created)": { "ge": 1 },
    "month(created)": { "le": 6 }
  }
}
The year and month functions extract integer components from DateTime properties. They do not support time-of-day filtering. For precise date ranges, use direct comparison operators (gt, lt) on the full DateTime value instead.

Step 4: Use String Length for Validation Queries

Filter for entities where a property exceeds a specific length:
{
  "where": {
    "length(description)": { "gt": 500 }
  }
}
This finds work items with descriptions longer than 500 characters — useful for identifying overly verbose requirements.

Step 5: Use IndexOf for Substring Detection

Search for entities containing specific patterns:
{
  "where": {
    "indexof(title, 'REQ')": { "ge": 0 }
  }
}
A return value of 0 or greater indicates the substring was found. A value of -1 means the substring is not present.

Step 6: Apply Functions in Dynamic Where Conditions

In your sheet configuration, you can use function expressions within dynamic where conditions that include $context references:
sources:
  - id: requirements
    from: SystemRequirement
    query:
      where:
        tolower(status): { ne: "rejected" }
Function expressions are evaluated server-side during query processing. Complex function nesting may have performance implications for large datasets. Verify the behavior with your specific Polarion instance.

Function Expression Quick Reference

diagram

Verify

After configuring a function expression in your query:
  1. Open the powersheet document in Polarion
  2. You should now see filtered results that match the function-transformed criteria
  3. Test edge cases: empty strings with trim, mixed-case values with tolower
  4. Confirm that the result count matches expectations from a manual Polarion search

See Also

Source Code
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/common/modules/configuration/helpers.ts
  • FnExpression.java
  • prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/__tests__/odata-where-merger.test.ts
  • Query.java
  • QueryExecutorTest.java