DocsBuyersCustom Field Filters & Nested AND/OR

Custom Field Filters & Nested AND/OR

Build buyer filters on custom fields with nested AND/OR group logic. Case-type filters, recency rules, numeric ranges, complex branching, and FAQs for Lead Distro AI.

Last updated:

What Custom Field Filters Do

Custom field filters let buyers selectively accept leads based on the values of campaign-specific custom fields — case type, incident date, monthly bill, roof type, etc. Combined with nested AND/OR group logic, you can express arbitrarily complex eligibility rules without writing code.

Filter Operators

OperatorUse case
`==` Equals`case_type == auto_accident`
`!=` Not equals`source != affiliate_xyz`
`IN` In list`state IN [TX, FL, CA]`
`NOT IN``source NOT IN [low_quality_source_a, low_quality_source_b]`
`>` `<` `>=` `<=``monthly_electric_bill >= 150`
`CONTAINS``email CONTAINS @company.com`
`DOES NOT CONTAIN``email DOES NOT CONTAIN @mailinator.com`
`IS EMPTY` / `IS NOT EMPTY``incident_date IS NOT EMPTY`
`>= N days ago` / `<= N days ago``incident_date >= 730 days ago` (within last 2 years)

Nested AND/OR Groups

Filters at the top level combine with AND by default — every rule must pass. Wrap rules in an OR group to allow either branch to pass. Nest groups for branching logic like `(A AND B) OR (C AND D)`.

Example: Compound Rule

Buyer accepts leads from Texas with auto accidents within 2 years, OR Florida with truck accidents within 18 months:

(state == TX
  AND case_type == auto_accident
  AND incident_date >= 730 days ago)
OR
(state == FL
  AND case_type == truck_accident
  AND incident_date >= 545 days ago)

Lead Timeline Shows Why a Buyer Was Rejected

When a lead doesn't reach a buyer because of a filter rejection, the lead timeline shows the specific rule group that failed for each eligible buyer. Open the lead detail page → Timeline tab — useful for debugging 'Why didn't Buyer X get this lead?' questions during onboarding or buyer disputes.

Start simple — a single AND condition. Add complexity only when you hit a real routing problem. Deep-nested filters are hard to debug and prone to subtle bugs (an inverted AND/OR can quietly route the wrong leads for weeks). When in doubt, build a separate buyer with a simpler filter instead of cramming logic into one filter group.

Frequently Asked Questions

How do nested AND/OR groups work in Lead Distro AI buyer filters?
Top-level rules combine with AND by default. Wrap rules in an OR group to allow either branch to pass. Nest groups for branching logic like `(state == TX AND case_type == auto) OR (state == FL AND case_type == truck)`. Build visually in the filter UI by dragging rules into and out of groups.
Can I filter on custom fields that don't exist on every lead?
Yes — use the `IS EMPTY` / `IS NOT EMPTY` operators. Example: `attorney_representation IS NOT EMPTY` only matches leads where the field has a value. For required-field enforcement, set the field as required in Field Mapping so leads without it are rejected at ingest before reaching any buyer filter.
How do recency filters work (e.g., 'within last 2 years')?
Use the `>= N days ago` operator on date fields. `incident_date >= 730 days ago` matches leads where incident_date is within the last 730 days (~2 years) from the current moment. The comparison is dynamic — each lead is evaluated against the current date at ingest time, so a buyer's recency rule stays accurate without manual updates.
Why isn't a buyer receiving leads I expect them to receive?
Open a sample lead's detail page → Timeline tab. The timeline lists every eligible buyer and the specific rule that rejected each one (state filter, zip filter, custom field, schedule, cap-hit). 80% of 'why isn't this buyer getting leads' questions resolve in 30 seconds with the timeline view.
Can a filter rule reference multiple fields with arithmetic?
Not natively — filters are atomic comparisons (field op value). For arithmetic across fields (e.g., `revenue - cost > 50`), use a campaign-level transform to pre-compute the derived value during ingest, then filter on the derived field. This is cleaner than complex filter expressions and supports use in multiple buyer filters.
How many filter rules can a buyer have?
No hard limit — but performance and maintainability degrade past ~20 rules per buyer. If you find yourself approaching that, the buyer's eligibility is probably better expressed as two separate buyers (one for each major branch of logic) rather than one buyer with deep nested filters. Two simple buyers beat one complex one.

If you have any questions, send us an email at support@leaddistro.ai