Operations

VICIdial custom fields: types, setup and loading leads

How to add custom fields to a VICIdial list: switch the feature on, where to define a field, what each field type does, and how leads fill them.

By Published 6 min read
A glowing form of three input bars on a dark blue grid

To the point

A custom field is an extra question on a list: a policy number, a renewal date, a pick-list. To add one:

  1. Switch the feature on. It is off by default, for the whole system.
  2. Define the field on the list: a label, a name the agent reads, and a type.
  3. Fill it: agents type in it on the FORM tab, and leads loaded with a value for its label arrive already filled.

What a custom field is

VICIdial gives every lead the same standard fields: name, address, phone, email, comments and so on. A custom field adds a field of your own to one list, and only that list. Agents see the list's custom fields in a FORM tab on the agent screen.

Three things to know first:

  • It belongs to a list, not to a campaign. Two lists in the same campaign can ask different questions.
  • The feature is off by default. The system setting Enable Custom List Fields is 0 until someone changes it, and until then the custom fields page shows ERROR: Custom Fields are not active on this system.
  • A field's label is also its key. It names the column that holds the answers, and it is the name you use to load a value into it.
A custom field's path: defined on the list, stored in a column named after its label, shown to the agent and loaded by the same label
From definition to agent screen

Add a field in admin.php

  1. Open the list in Lists and look for the line Custom fields defined for this list, with a count. It links to the custom fields page for that list.
  2. Add a field. Your user needs User Level 8 or more and Custom Fields Modify set to 1 (on Modify User, shown once the feature is on).
  3. Fill the form below, and save.
SettingWhat it does
Field LabelThe database name. Unique within the list, 2 to 50 characters, no spaces or punctuation.
Field NameWhat the agent reads next to the field. Spaces are fine, punctuation is not, 2 to 50 characters.
Field DescriptionOptional, up to 100 characters, shown in admin only.
Field RankThe row on the form, lowest on top.
Field OrderFields with the same rank share a row, in this order, left to right.
Re-Rank Fields BelowYES moves the fields at an equal or lower rank down one place. Default NO.
Field HelpOptional text the agent sees behind a help link.
Field DefaultThe value used when nothing is loaded. NULL turns it off.
Field RequiredY forces the agent to fill it before hanging up; INBOUND_ONLY does so only on in-group calls. Needs the campaign's Allow Required Fields option on too.
Field Name PositionLEFT or TOP. Default LEFT.

The field types

Field Type decides what the agent sees. The default is TEXT.

TypeWhat the agent gets
TEXTA single line. Field Size is the characters shown, Field Max the characters allowed.
AREAA multi-line box. Size is the width, Max the rows shown. Use it for long notes.
SELECTA pull-down menu with one choice.
MULTIA list box where several choices can be picked. Size is how many show.
RADIORadio buttons, one choice.
CHECKBOXCheckboxes, several choices.
DATE and TIMEA calendar popup, and a time box. A default of 3 means three days, or three minutes, from now.
DISPLAYText shown to the agent, not editable, with the field name.
SCRIPTText from the options box, with script variables filled in, and no field name.
READONLYThe stored value, shown and not editable.
HIDDENNot shown, but data can be imported into it and exported from it. Scripts and web forms can read it.

Other types exist for special cases: HIDEBLOB for data stored as a BLOB, SWITCH to move the form to another list's fields, SOURCESELECT for a menu that follows another field, and BUTTON to save the form and reload it.

For SELECT, MULTI, RADIO and CHECKBOX, fill Field Options with one choice per line, as label, text. Neither part may contain punctuation, and the first has no spaces, for example electric_meter, Electric Meter. For RADIO and CHECKBOX, Option Position sets HORIZONTAL or VERTICAL.

Limits and copies

  • Field Cost. The fields on one list have a combined cost that must stay under 65,000. That allows hundreds of fields, but a few very long TEXT fields use it up fast. Pick AREA for long text, which is stored differently.
  • Default fields as labels. A field can use a standard label such as vendor_lead_code, email or comments. VICIdial then reads the standard column instead of adding a new one.
  • Field Duplicate. When you create a TEXT field, it can duplicate an existing one, so a value typed in the copy is written back to the original.
  • Copy Option. When you copy fields from one list to another, APPEND adds the ones that are missing and touches nothing else. UPDATE overwrites the matching ones, and data can change or be lost. REPLACE removes all fields on the destination list and their data.

A label can't be changed in admin.php once the field exists. To change it there, you remove the field, which deletes its column and every answer in it, and add a new one. So pick labels with care, and check what is stored before you remove a field.

Filling the fields

By the agent. Agents see the list's fields on the FORM tab of the agent screen.

By add_lead. When a lead is added through the add_lead API with custom_fields=Y, send one parameter per field label and the values are stored in the list's custom table. A defined field you do not send is written empty. The add_lead guide covers the call, and loading a CSV covers the file route.

By API. The non-agent API can read a list's definitions with list_custom_fields (a user with Modify Lists), and update_list can add, change or delete one field per request with custom_fields_add=Y, custom_fields_update=Y or custom_fields_delete=Y. Those three need Custom Fields Modify.

In the Trustane console

Open the list in Lists and pick the Extra questions tab:

  1. If the server shows Custom fields are switched off on this server, press Switch it on. This applies to the whole server.
  2. Press Add a field, and pick a type from the groups: Text, Choice, Date and time, Display only, Special.
  3. Set what the agent reads, the label, the choices and whether it is required.
  4. Check Preview as an agent, then press Review changes. The plan lists what will change on the server, and Apply to the server makes it live. A change that deletes answers is counted first and asks you to type that number. A removed field can't be brought back.
  5. Open Lead-loading keys to see the label for each field. Each label is the key for loading leads, by file or by API.

Field sets save the whole group of fields under a name, so you can use it on another list or another server. See loading a CSV to fill the list.

VICIdial is a trademark of its owner. Trustane is an independent hosting provider.

Sources

  1. VICIdial help text for the custom field settings (Enable Custom List Fields, Field Label, Field Type, Field Options, Copy Option and the rest), SVN r4038
  2. VICIdial non-agent API, the custom_fields switch on add_lead and the custom field functions on lists, SVN r4038
  3. Trustane's model of a list's custom fields, read off a real ViciBox
  4. The Extra questions tab and its field builder in the console
  5. Trustane's own flow diagram of a custom field from its definition to the agent screen, drawn from the checks above

Every VICIdial guide and article in one place: the complete VICIdial guide.

Trustane

Managed VICIdial hosting

Run it on cores of your own

Managed VICIdial, billed by the hour against a balance you top up.

Free for 7 days. Verify a payment method to start. Free-mail and some other sign-ups wait for a person, within one business day. Skip the wait with a paid server: ask in its first 7 days and its hosting is refunded in full.