Draft Documentation

This guide is currently in development. Content may be incomplete or subject to change.

~12 minutes

Campaign Database

Learn how to create and manage persistent databases for your campaigns. Store customer data, enable lookups during calls, and track record versions over time.

What a campaign database is

A campaign database keeps the customer records of one campaign. It stays in place from one run of the campaign to the next, and you update it whenever you import a new Excel file. A list (also called a dataset) is different: it holds the contacts for a single run.

DatabaseList
How long it lastsUntil you delete its recordsOne run of the campaign
How you update itImport a new Excel file at any timeUpload a new list for the next run
Earlier valuesKept as earlier versions of each recordNot kept
What it is forLooking up and checking customer data during conversationsChoosing who the campaign contacts in a run

Common uses

Checking who the customer is

During a call, the agent can check who the caller is by comparing details such as the RUT (the Chilean tax ID) with the records in the database. You set this up with an authentication action whose method is Campaign Database.

Looking up customer data

During a conversation, the agent can look up the customer's record and answer with their own data, such as a balance or a due date. You set this up with a Database Lookup action.

Adding database data to a list

When you upload a list, each row whose identifier matches a database record receives that record's data, so the campaign can use it during the run.

Change history

Each import that changes a record saves a new version of it, so you can see when the record changed.

Creating the database

The database is created the first time you import an Excel file into it. The app reads the first sheet of the file: the first row must hold the column names, and each row below it is one record. The app suggests a type for each column, and you review the types before the import starts.

Steps

  1. Open your campaign. In the left menu, under Lists and data, click Database.
  2. Click Import Data. If the database already has records, the button is called Import.
  3. In the Upload Excel File box, click Browse Files and choose an Excel file (.xlsx or .xls) of up to 100 MB.
  4. In Review Column Schema, check the Data Type of each column. A column marked Suggested needs your decision: click Apply to accept the suggested type, or choose another type in the list.
  5. Under Unique Identifier Column, choose up to 3 columns that together identify each record, such as the RUT.
  6. Click Start Import. If some columns are still waiting for a type decision, the app asks whether to import them as text. Click Import as text to continue, or Cancel to go back and choose the types.
  7. When the import ends, check the totals and click Back to Campaign.
Database section of a campaign with the record totals and the Export Excel, Lifecycle and Import buttons

Tip: Use clear column names in the first row of your Excel file. They become the field names in the database. Spaces, dashes, dots and slashes in a name are changed to underscores, so "Saldo Pendiente" becomes "Saldo_Pendiente".

Columns and their types

The schema is the list of columns in the database and the type of each one. The type tells the app how to read the values in that column. On the import page, the Review Column Schema table shows one row per column:

  • Data Type: the type of the column.
  • Identifier: marks the column as part of the unique identifier.
  • Include: turn it off to leave the column out of the database. An identifier column can't be left out.
  • Sensitive: turn it on to hide the column's values from the AI agent.
  • Samples: the first values found in the file, to help you choose the type.

Column types

  • String: free text.
  • Number: numbers, such as a quantity or a customer number.
  • Decimal: numbers with decimals, such as an amount.
  • Date: a date without a time.
  • DateTime: a date with a time.
  • Boolean: yes or no values (true or false).
  • Phone: phone numbers.
  • Email: email addresses.
  • Credit Card, Expiry Date and CVV: card data. The AI agent never sees these columns.
  • RUT Body (Numeric): the RUT number without the check digit, saved as a number (for example 27851867). Use it when the check digit is in a separate column.
  • RUT Full (Plain): the full RUT with its check digit, without dots or dash (for example 278518671).

Note: The app doesn't check whether phone numbers, email addresses or RUTs are valid. If a value can't be read as the column's type, it is saved as text. On the import page the type names appear in English; in the Edit Column Types window they appear in your language.

Review Column Schema table with the Data Type, Identifier, Include, Sensitive and Samples columns

To change a column's type or display name after an import, click the columns total at the top of the Database section. In the Edit Column Types window, change the Display Name or the Data Type and click Save Changes. The AI uses the display name when it talks to customers, for example "RUT" instead of "Rut2".

Unique identifier

Every database needs at least one identifier column, and you can choose up to 3. The app uses the identifier to:

  • Find the existing record when a new import brings new values for it
  • Find the customer's record during a conversation
  • Match the rows of a list you upload with database records

Rows with an empty identifier value are not imported and are counted as Skipped.

One column

One column identifies each record, for example the RUT, a customer number or an email address.

Several columns

Two or three columns together identify each record. For example, use RUT and policy number when one customer can have several policies.

Important: Keep the same identifier columns on every import. You can still change them on a later import, but then the rows in the file no longer match the existing records and are added as new records.

Importing more data

To add or update records later, open the Database section, click Import and choose a new file. Check the Data Type of each column again, because the types you leave in the table are saved for the database. Then choose how the file is applied under Import Mode.

Import modes

Add / Update

This mode is selected by default and fits most imports.

It adds the records that are new and updates the records whose identifier already exists. Records that are not in the file stay as they are. New columns in the file are added to the database, and the existing columns are kept.

Replace All

It marks all current records as deleted and imports the file as the new set of records. The database columns become the columns of the file. Use it only when the file holds the complete, current data. This mode isn't offered when the database uses assignment periods, which you choose with the Lifecycle button in the Database section.

Import Settings box with the Unique Identifier Column field and the Add / Update and Replace All import modes

When the file has different columns

On later imports, the app compares the columns of the file with the columns of the database. If they differ, it shows Schema Changes Detected with a list of the changes:

  • New Columns: columns in the file that the database doesn't have yet.
  • Removed Columns: database columns that are missing from the file.
  • Type Changed: columns whose type was changed and confirmed.
  • Click Accept Changes to use the columns of the file. Then review the import settings and click Start Import.
  • Click Keep Current Schema to keep the database columns as they are. Extra columns in the file are ignored, columns missing from the file are left empty, and the import uses Add / Update.
  • Click Cancel Import to stop without importing.
Schema Changes Detected message with the New Columns and Removed Columns lists and the Accept Changes, Keep Current Schema and Cancel Import buttons

Important: If the file is missing an identifier column, the import can't continue. The app shows Validation Failed and lists the Missing Key Columns. Add those columns to the file and import it again.

Import progress and results

The import runs in the background, 100 rows at a time. The page shows a progress bar and the number of rows processed. When the import ends, the page shows how many records were:

  • Inserted: new records.
  • Updated: existing records that got new values. A new version is saved for each one.
  • Unchanged: existing records whose values were the same.
  • Skipped: rows that were not imported, for example rows with an empty identifier.
  • Errors: rows that could not be saved. This total appears only when there are errors.
Import results with the Inserted, Updated, Unchanged and Skipped totals

The last five imports appear under Import History in the Database section, with the file name, date, number of rows and status. If an import fails, the page shows Import Failed with the first row errors; click Start Over to try again with a corrected file.

Record history

When an import changes the values of a record, the app saves a new version of that record and keeps the earlier ones. If the values are the same, no new version is saved.

How versions work

  1. The first import saves version 1 (v1) of each record.
  2. Each later import that changes a record's values saves a new version (v2, v3 and so on).
  3. Earlier versions are kept, and you can see them in the record's history.
  4. Conversations, lookups and lists always use the current version.

Viewing a record's history

In the records table, click the History button (the clock icon) in the record's Actions column. The Record History window lists each version with its date, the file row it came from and its status: Current, Archived (an earlier version) or Deleted. Under each version you see the values of the first four columns.

Record History window with the versions of a record, their dates and statuses

Tip: Use the history to see when a record changed and which file row the change came from.

Working with the records

The top of the Database section shows four totals: Records, Database Imports, columns and Last Import. Below them, a table lists the current records. Identifier columns come first and are marked with a key icon, and the Version column shows each record's current version.

Searching and filtering

  • Search records...: finds the records whose identifier contains the text you type. It doesn't search the other columns.
  • Column filter: click the filter icon in a column header to show only the records that match a value in that column.
  • Pages: the table shows 50 records per page. Use the page buttons below the table to move between pages.
  • Columns: drag a column header to move the column, or drag its edge to make it wider.
Records table with the search box, key columns and a column filter

Exporting the records

Click Export Excel to download an Excel file with all current records. Deleted records and earlier versions are not included. Depending on your permissions, some contact data may appear masked in the file.

Deleting records

To delete one record, click the trash button in its Actions column. To delete several, tick their boxes and click Delete Selected. Then confirm with Delete. Deleted records are no longer used by the campaign, and their history shows the status Deleted.

Using the database with lists

When you upload a list in the Lists section, the app matches it with the campaign database on its own. You don't need to turn anything on.

How rows are matched

By identifier

When you upload the list, choose its Identifier Column. The app compares that column with the first identifier column of the database, and each row that matches a record receives that record's data. The validation step shows how many rows are Matched and Unmatched. Unmatched rows are still processed, without database data.

By phone number

If the list has no identifier column, the app checks the list's phone numbers against the database and shows how many are In Database and Not in Database. This check only counts the phones. To add database data to the rows, choose an Identifier Column.

Names of the database fields in a list

The database data added to a row keeps the database column names with "maindb_" in front, so they don't clash with the list's own columns:

// Example: a list row with database data
{
  "phone": "+56912345678",        // From the list
  "name": "Juan",                 // From the list
  "maindb_Saldo": 150000,         // From the database
  "maindb_Ultimo_Pago": "2024-01" // From the database
}

Tip: Use these maindb_ names in your flow variables and message templates to use database data during the run.

Creating a list from the database

  1. In the campaign's left menu, click Lists, then click Create from database.
  2. Type a name under Dataset name and choose the Flow. If you leave Campaign default, the list uses the campaign's flow.
  3. Under Scope, choose Current period or Complete base.
  4. To use only some records, set a filter: choose a column, a condition and a value. Click Add filter for more filters.
  5. Click Preview count to see how many records match, then click Create. The Create button works only when at least one record matches.