VICIfast
Operations

How to write a filter on a custom lead field

Filter VICIdial leads on a custom field like vendor_lead_code so your campaign dials only the segment you choose, and test it before enabling.

VICIfast Support
··3 min read
How to write a filter on a custom lead field

The built-in columns cover the obvious cuts: state, phone number, call counts. But your business often segments leads on something only you track, like a tier, a source code, or a vendor batch. The good news is that a Lead filter can target any column your records hold, including the extra ones, so your Campaign dials exactly the segment you want.

Which fields you can filter on

Each Lead record has a set of standard fields plus a few flexible ones you can repurpose. A common one is the vendor lead code, stored in the vendor_lead_code column. Teams often load a label there at import time, such as GOLD for premium leads or a batch identifier from a Lead source. If you treat that column as a Custom field, you can slice your data on it without changing the schema.

The SQL to use

To call only leads tagged GOLD, set Filter SQL to:

vendor_lead_code = 'GOLD'

Want more than one tag? Use IN with a quoted, comma-separated list:

vendor_lead_code IN('GOLD','SILVER')

You can filter on any real column the same way. To call only leads from a particular source you might use source_id = 'WEB42', and you can combine conditions: vendor_lead_code = 'GOLD' and state IN('CA','NV'). Just match the exact text in your data, including capitalization, and never begin or end the fragment with AND. The Hopper adds that part when it merges your filter into its own query.

A quick tip on values: text comparisons are usually case-sensitive, so GOLD and gold may not match the same rows. Decide on one convention when you load your data and stick to it. If you are unsure what is actually in a column, look at a handful of records first rather than guessing the spelling.

How the hopper applies it

flowchart TD
  A[Hopper cron runs] --> B[Read campaign filter SQL]
  B --> C[Append filter as AND clause]
  C --> D{Custom field value matches}
  D -->|Yes| E[Load lead into hopper]
  D -->|No| F[Skip lead]
  E --> G[Dialer calls the segment]

Every refill, the hopper reads your custom-field condition and only loads records that match, skipping the rest without altering your data. That is what makes filters so handy: one campaign can chase the GOLD segment with Predictive dialing while another works the leftovers, all from the same underlying list.

Setting it up

  1. Confirm the column name and the exact values in your data so your match is spelled correctly.
  2. Add a filter with a short Filter ID and a descriptive Filter Name.
  3. Paste your fragment into Filter SQL, then save and attach it to the campaign.

Test it before you enable

Custom-field filters are the easiest to typo, because the value depends entirely on how your data was loaded. One wrong character and the filter matches nothing. Run Test On Campaign on the filter page first; it previews how many leads stay dialable so you catch a mismatch before agents log in. Keep your DNC (do not call) scrubbing active too, so a narrow segment filter never bypasses your suppression rules.

To see how filters fit into a disciplined dialing operation, read our quality control guide. For more on writing the SQL itself, see filter SQL syntax explained.

Custom-field filtering is part of every VICIfast plan, with a managed dialer live in under 40 seconds. Compare plans on our pricing page.

About VICIfast LLC

VICIfast LLC operates a managed VICIdial hosting + BYOI service for outbound and inbound call centers. We run the dialers, the carriers, the recordings pipeline, and the compliance plumbing so operators don’t have to.

Citing this article

VICIfast Engineering. “How to write a filter on a custom lead field”. VICIfast LLC, June 26, 2026. Retrieved from https://vicifast.com/blog/build-vicidial-filter-by-custom-field

Have questions?

Related posts

You might be interested in

VICIfast newsletter

Liked this? Get the next one in your inbox.

We ship the kind of stuff you just read — concrete, numbers-first, no drip. One email when a new post goes live. Unsubscribe in one click.

Comments

Comments are reviewed before they appear. We never publish your email.

No comments yet — be the first.