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:| Function | Arguments | Return Type | Description |
|---|---|---|---|
toupper | string | String | Converts value to uppercase |
tolower | string | String | Converts value to lowercase |
trim | string | String | Removes leading/trailing whitespace |
concat | string, string | String | Joins two strings together |
substring | string, start, length | String | Extracts a portion of a string |
replace | string, string | String | Replaces substring occurrences |
length | string | Int32 | Returns character count |
indexof | string, string | Int32 | Finds position of substring |
year | DateTime | Int32 | Extracts year from date |
month | DateTime | Int32 | Extracts month (1-12) from date |
Step 1: Use String Functions in Where Clauses
To filter entities with case-insensitive matching, usetolower or toupper on string properties in your query configuration:
Step 2: Use Trim for Clean Comparisons
When data may contain leading or trailing whitespace, usetrim to normalize values:
Step 3: Use Date Functions for Time-Based Filtering
Extract date components to filter by year or month:Step 4: Use String Length for Validation Queries
Filter for entities where a property exceeds a specific length:Step 5: Use IndexOf for Substring Detection
Search for entities containing specific patterns: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:
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
Verify
After configuring a function expression in your query:- Open the powersheet document in Polarion
- You should now see filtered results that match the function-transformed criteria
- Test edge cases: empty strings with
trim, mixed-case values withtolower - Confirm that the result count matches expectations from a manual Polarion search
See Also
- Use Predicates — comparison operators and logical combinators
- Write an Entity Query — query structure fundamentals
- Optimize Queries — performance strategies for complex queries
- Filter by Document — document-scoped filtering
Sources
Sources
Source Code
prod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/common/modules/configuration/helpers.tsFnExpression.javaprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/__tests__/odata-where-merger.test.tsQuery.javaQueryExecutorTest.java