CRM · Save current filters as a segment
Turns the ad-hoc filter set from the customer list into a reusable, named segment by handing the serialised filters to the segment builder.
| Area | CRM |
| Routes | crm.users.index · crm.segments.new |
| Centre modules | crm |
| Staff levels | root · admin · manager · crmmanager |
| Models | segment |
| UI label | crm.new-segment |
| Coverage | 2 use cases · 1 happy · 2 failure |
How it works
saveSegment(filters) transitions to crm.segments.new with filtersJSON and filterType as query params — so the segment builder opens pre-populated. filterType carries the and/or combinator from enums/segment-filters-types.
Use cases
Why someone opens this (2)
- Promoting an exploratory audience into a segment used by email campaigns, push notifications and proposals.
- Standardising a recurring audience definition so colleagues reuse it instead of re-filtering.
Path map
flowchart LR F(["Save current filters as a segment"]):::feat F --> H1["Filters promoted to a segment"]:::ok F -.-> X1["Void filter values"]:::bad F -.-> X2["Segment name missing"]:::bad classDef feat fill:#157068,stroke:#157068,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Filters promoted to a segment
- User applies filters on the customer list and clicks save as segment.
- Filters are JSON-serialised into the query params and the segment builder opens.
- User names the segment and submits; the segment is created with the same filter definition.
Failure paths
Void filter values
Cause — A filter row with no value.
What happens —
applyFilters/saveChangessetshowFilterWarningfirst; the transition is only offered from an applied state.
Segment name missing
Cause —
segmentNameblank on submit.What happens — The segment model’s presence rule fails with the generic
requiredmessage and_scrollTop()brings the error into view.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Filters promoted to a segment
- ⛔ Void filter values
- ⛔ Segment name missing
Implementation
app/controllers/crm/users/index.jsapp/mixins/segment-filter-mixin.jsapp/components/segment-filters.js
Translation keys (3)
Key English crm.new-segmentNew segment allall any-ofany of
Related
- Same area — Customer list & filtering · Customer create & edit · Customer deletion with unsubscribe notice · Customer CSV export with column picker · Customer CSV import · Children CSV import · AI natural-language customer filter · Segment list, refresh & export · Segment builder with automatic tag actions · Segment categories · User tags (user types) · Customer receipts tab & ticket-stamp generation · Customer loyalty — raffle tickets · Customer loyalty — cards & stamps · Customer loyalty — rewards · Customer loyalty — coupon exchanges · Customer children (dependants) · Receipt verification queue · Store list, filters & exports · Store create & edit · Store CSV import · Store labels (store types) · Customer action log (dormant)
- Shares data with — Activity editor (loyalty mechanics, rules & targeting) · Email campaign list, duplication & stop · Email campaign builder (wizard, A-B test, scheduling) · Proposal editor (content, coupon, push, AI images) · Push notification editor (scheduling, geofencing, deep links) · Filter & segment builder component
Generated from doc/feature-inventory.json · id crm-save-filters-as-segment · commit 276788ca6