Repository navigation
Conversation
paustint
added this pull request to stack #2120
October 2, 2026 21:03
paustint
marked this pull request as draft
October 2, 2026 21:19
paustint
force-pushed
the
feat/query-builder-formula-filter
branch
from
October 2, 2026 21:21
09532aa to
b6dcf7e
Compare
paustint
force-pushed
the
feat/query-builder-formula-filter
branch
from
October 11, 2026 14:51
b6dcf7e to
d931bdb
Compare
1 of 2 tasks
paustint
removed this pull request from stack #2120
October 11, 2026 14:52
paustint
added this pull request to stack #2143
October 11, 2026 14:53
paustint
marked this pull request as ready for review
October 14, 2026 22:30
paustint
force-pushed
the
feat/query-builder-formula-filter
branch
from
October 14, 2026 22:30
d931bdb to
468f02c
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Second-field selection can overwrite newer edits, and formula fallback can leave incorrect value controls.
3 open findings
What changed in this PR
Adds FORMULA() arithmetic filters to Jetstream’s Query Builder, including query restoration and summaries.
Changes:
- Adds field-math controls and compatible second-field filtering.
- Composes and restores FORMULA() conditions, including subqueries, and preserves grouped filter functions.
- Adds unit coverage and updates field locators.
| File | Description |
|---|---|
| libs/ui/src/lib/expression-group/ExpressionContainer.tsx | Propagates formula rules and refreshes row metadata. |
| libs/ui/src/lib/expression-group/ExpressionConditionRow.tsx | Adds math and second-field controls. |
| libs/types/src/lib/ui/types.ts | Defines formula operands and filtering callbacks. |
| libs/test/e2e-utils/src/lib/pageObjectModels/QueryPage.model.ts | Makes Field locators exact. |
| libs/shared/ui-utils/src/lib/shared-ui-utils.ts | Composes formula conditions and summary text. |
| libs/shared/ui-core/src/query/RestoreQuery/query-restore-utils.ts | Restores formula operands. |
| libs/shared/ui-core/src/query/RestoreQuery/__tests__/query-restore-utils.spec.ts | Tests restoration and unavailable fields. |
| libs/shared/ui-core-shared/src/query-filter.utils.ts | Defines compatibility rules and warnings. |
| libs/shared/constants/src/lib/query-filter-constants.ts | Adds formula constants. |
| libs/shared/constants/src/index.ts | Exports formula constants. |
| libs/features/query/src/QueryOptions/QueryFilter.tsx | Enables Field Math for WHERE filters. |
| libs/features/query/src/QueryOptions/accordion-titles/QueryFilterTitleSummary.tsx | Displays formula summaries. |
| libs/features/query/src/QueryOptions/__tests__/query-filter-formula.spec.ts | Tests composition and field eligibility. |
| libs/features/query/src/QueryOptions/__tests__/query-filter-formula-row.spec.tsx | Tests controls and field choices. |
| libs/features/query/src/QueryBuilder/QuerySubqueryLevel.tsx | Includes formulas in subquery tooltips. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Field pickers that can drill into related objects kept using the row as it was when the picker first appeared. Changing the field on an existing filter, order by or group by row undid the operator, value, sort direction or function chosen since, and the mass update alternate field picker could undo other option changes the same way.
Choosing "Add / Subtract Fields" under Field Math on a WHERE filter row adds a
math operator and a second field, limits the comparison operators to the ones
FORMULA() supports, and composes to FORMULA('A - B') > 100. Field Math is
only offered for number, currency, date and datetime fields, the second field
only lists fields that can be combined with the first, and rows warn when
date and datetime fields are mixed. Changing the first field to one Field Math
does not support turns the row back into a regular filter. The help text notes
that FORMULA() is a beta, available only in sandbox, Developer Edition and
scratch orgs on API v68.0+.
Filter rows inside a group now go through the same builder as standalone
rows. The group builder previously dropped the row's function, which also
affected functions used in grouped HAVING filters.
Closes #2118
paustint
force-pushed
the
feat/query-builder-formula-filter
branch
from
October 15, 2026 19:15
468f02c to
4d30e4f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Adds the Winter '27 SOQL
FORMULA()function to the Query Builder filters.+/-picker and a second field, limits the comparison operators to the onesFORMULA()supports (=,!=,<,<=,>,>=), and composesFORMULA('Amount - ExpectedRevenue') > 100.FORMULA()restore into the builder, including in subqueries. If either field is unavailable the filter is reported as unsupported, as before.FORMULA(Amount - ExpectedRevenue).The row reuses the existing per-row
functionslot, so the new state is an optionalformulaoperand onExpressionConditionRowSelectedItems.Behavior change outside FORMULA
Rows inside a filter group now go through the same condition builder as standalone rows. The group builder previously dropped the row's
function, which also affected functions used in grouped HAVING filters.Closes #2118
Test plan
queryFilterHasValue, help text, Field Math availability, second field eligibility, restore round trip and unsupported fallback, row rendernx typecheckandnx testfor the affected projectsquery-builder.spec.tsE2E locally (theFieldlocator is now exact since the row has aField Mathlabel too)