CRM · Segment builder with automatic tag actions

Two-tab editor for a segment: general data (name, category, account types) plus a live filter builder that previews the matching customers, with optional rules that automatically add or remove user tags as people enter or leave the segment.

AreaCRM
Routescrm.segments.new · crm.segments.edit
Centre modulesai · crm · employees_segments
Staff levelsroot · admin · manager · crmmanager
Modelsbuilding · segment · user · user-account-type · user-type · usertype-linked-segment
UI labelcrm.new-segment
Coverage3 use cases · 1 happy · 6 failure

Known issues (1)

How it works

The preview table reuses the customer columns, and the same AI filter and export affordances as the customer list are available here. addNewAutomaticActionType / removeAutomaticAction manage usertypeLinkedSegments fragments, each needing both a usertype and a dynamic flag — the model validates this with a single combined message. isLifeCycleSegment flags segments driven by lifecycle rules. When the centre has employee segments, at least one account type is mandatory (userAccountTypes.length.minimum 1). New user tags can be created inline (addNewUserType), which validates the tag model separately into userTypeErrors.

Use cases

Why someone opens this (3)

  • Defining ‘families with children under 12 who shopped in the last 90 days’ once and reusing it everywhere.
  • Auto-tagging customers as VIP when they enter a segment and untagging them when they leave.
  • Restricting a segment to employee account types in centres with employee segmentation.

Path map

flowchart LR
    F(["Segment builder with automatic tag actions"]):::feat
    F --> H1["Segment created with an automatic tag rule"]:::ok
    F -.-> X1["Name missing"]:::bad
    F -.-> X2["Account types missing"]:::bad
    F -.-> X3["Incomplete automatic action"]:::bad
    F -.-> X4["Inline user-tag creation invalid"]:::bad
    F -.-> X5["Filters not applicable"]:::bad
    F -.-> X6["Save rejected"]:::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

Segment created with an automatic tag rule

  1. User names the segment, picks a category and (if required) account types.
  2. Filters are assembled in the builder; the preview refreshes with matching customers.
  3. An automatic action is added: tag X, dynamic on.
  4. submit validates the segment and the linked-segment fragments and saves it.

Failure paths

QA checklist

Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.

  • ✅ Segment created with an automatic tag rule
  • ⛔ Name missing
  • ⛔ Account types missing
  • ⛔ Incomplete automatic action
  • ⛔ Inline user-tag creation invalid
  • ⛔ Filters not applicable
  • ⛔ Save rejected

Implementation


Generated from doc/feature-inventory.json · id crm-segment-builder · commit 276788ca6