Settingsintermediate

Create a detection rule

Build a Sidekick detection rule that extracts structured data from messages and writes it to a custom field. Walks through the pattern-builder method with a worked Order Number example.

5 min read

Create a detection rule

Build a working detection rule from scratch. By the end you’ll have an Order Number rule that picks ORD-123456 (and similar) out of inbound messages and writes the value to a conversation custom field.

Before you start

  • Admin permissions on Sidekick settings
  • The destination custom field exists. For order numbers, this is typically a Text field on Conversations
  • Sample messages where the data appears (so you can test)

Steps — pattern builder method

  1. Open Settings → Sidekick → Detection rules.
  2. Click New rule.
  3. Fill in the basics:
    Name — descriptive (e.g. Order Number — ORD prefix)
    Description — optional context for future maintainers
    Detection methodPattern builder
  4. Configure the pattern:
    PrefixORD-
    Allowed characters — digits only
    Min length — 6 (for 123456)
    Max length — 10 (allows up to ORD-1234567890)
    Suffix — leave empty
  5. Map to custom field:
    Target entity — Conversation
    Target field — order_number (or whatever the field’s key is)
    Skip if field already set — toggle on so manually-entered values aren’t overwritten
  6. Test the pattern. Atender provides a built-in test tool — paste sample text and verify what the rule matches. For example:
    Hi, I have a question about ORD-987654, can you help? → should match ORD-987654
    My account is ACC-12345 → should NOT match (different prefix)
  7. Set priority. Default priority is fine for most rules. Higher priority wins when multiple rules could match the same text.
  8. Save and enable.

Verify it worked

Send a test inbound message containing the pattern:

Hi, I’d like to check on order ORD-987654. Has it shipped yet?

Within a few seconds, open the resulting conversation:

  • The text ORD-987654 should be highlighted inline (if inline highlights are on)
  • The conversation’s order_number custom field should be populated with ORD-987654
  • If the value’s confidence is below the global threshold, it’ll be flagged for agent review instead of auto-saved

Other detection methods

This walkthrough used Pattern builder. The other two methods are configured similarly:

  • AI detection — instead of prefix/suffix/length, you write a plain-language description (“the customer’s affected product”). LLM cost per detection. Best for fuzzy data.
  • RegExp — you provide the raw regex (\bORD-\d{6,}\b). Best when pattern builder isn’t expressive enough or when you’re porting an existing regex.

See the detection rule types reference for picking which.

Common gotchas

  • Rule doesn’t match anything — Pattern is too strict (length wrong, charset wrong) — Use the test tool — paste sample text and adjust until it matches
  • Rule matches too much — Pattern is too loose (e.g. matching numbers anywhere in text) — Tighten — add prefix, increase min length, narrow charset
  • Rule matches but custom field stays empty — Mapping not set, or Skip if field already set is on and the field has data — Check the mapping; clear the field manually and re-test
  • Rule fires on agent replies too — Detection runs on all messages by default — Use rule conditions (if available in your version) to scope to inbound only

Where this rule shows up afterwards

Once enabled, the rule runs on every new message:

  • Detected values are visible in the Insights panel module (when enabled)
  • Mapped custom fields populate automatically (when above confidence threshold)
  • Below-threshold matches show amber for agent review
  • Stats appear in Sidekick analytics — see how many messages matched, success rate, false-positive flags

See also

Tags

Ai FeaturesHow To