Displaying Call History on the Start Page
When launching an outbound call from a campaign, it is sometimes required that previous call activity is shown on the start page to provide guidance for the agents, or meet calling restrictions associated with a call list.
Problem
We need to display additional information relating to the history of an outbound call when the agent runs the script:
-
The number of call attempts already made (call_attempts),
-
The maximum number of attempts allowed for each record (max_attempts)
-
The outcome of the last call attempt (last_outcome )
This information relates to call lists and previous call attempts and is therefore stored in the CallScripter database, more specifically in a table called tbl_outbound.
Solution
To accomplish this, we need to:
-
Access the CallScripter Database to Get information from the table tbl_outbound that relates to the current campaign and record.
-
Create variables that we can pass the information retrieved for the current record into, in order that we can…
-
Display the data in a text label.
Create three script variables
Add a text label
Add a text label to the welcome page of your script and add text and the variables to it.
Get the information from the CallScripter Database
Add a database control to the welcome page.
Step 1 - Run your script in test mode to get real reference value from the database. This will be shown in [var_reference] in the table of variables at the bottom of the screen.
Step 2 – configure the database get control. Choose CallScripter as the data source.
Step 3 – Enter the query to return the data to your script:
Step 4 – Enter the test value you collected in step 1 – it must be enclosed in apostrophes:
Step 5 - If your query is successful, you will be prompted to map the database fields to your variables:
Click Finish
A VERY brief explanation of SQL
A simple select query has three components:
· SELECT – Choose the fields in your database table that you want to display in your query. These should be separated with commas, e.g., field1, field2, field3.,
· FROM – the name of the table you want to SELECT the data FROM
· WHERE – the conditions that the data must meet in order to be returned from the query.
In this case, the information we need is in the CallScripter database in a table called tbl_outbound.
SELECT call_attemtps, max_attempts_last_outcome
FROM tbl_outbound
WHERE campaign id = ##
## represents your campaign id which should be added without quotes to the end of the where statement, e.g.
WHERE campaign id = 7
This will return all records for that campaign. We need to adjust this to show the record that the agent will see when they are viewing the welcome page of the script.
Each record in a call list has a reference associated with it. This reference is stored in a system variable var_reference.
You can update your query to use this variable in your where clause to limit the results returned to the set that relates to the current record:
SELECT call_attempts, max_attempts, last_outcome
FROM tbl_outbound
WHERE campaign_id = 7 AND reference=[var_reference]