$dialer.reportData
This method allows extending the call campaign report with arbitrary additional data.
Syntax
The method accepts three arguments.
Argument | Type | Description | Default value |
---|---|---|---|
header | String | Column header in the report | — |
value | String | Column value for the current number | — |
order | Number | Column order | 0 |
$dialer.reportData("Client age", $client.age);
$dialer.reportData("Feedback", $parseTree.text, 1);
When the method is called, a new column titled as header
gets added to the phone number and call attempt reports. The passed value
is written in the cell corresponding to the current phone number.
Column sort order
The optional order
argument determines how the new columns are arranged: they are sorted in descending order based on the value of order
, and in alphabetical order when it is the same for multiple columns.
For example, the columns below with the following order
values will be sorted like this:
Sex | First Name | Last Name | Patronymic | Attitude to smoking |
---|---|---|---|---|
1 | 0 | 0 | 0 | -1 |
How to use
Consider the following example script of a survey:
require: name/name.sc
module = sys.zb-common
theme: /
state: Start
q!: $regex</start>
a: Hello! What is your name?
state: Name
q: $Name
a: Hello, {{$parseTree._Name.name}}!
script:
$dialer.reportData("Name", $parseTree._Name.name);
a: What do you think about smoking?
state: Smoking
q: *
a: Okay, I’ll put it down as “{{$parseTree.text}}.”
script:
$dialer.reportData("Attitude to smoking", $parseTree.text, 1);
After the script has been finished, the call campaign report will contain two additional columns, Name and Attitude to smoking, recording every client’s responses to the appropriate question.
The Attitude to smoking column will go first, since its order equals 1. The Name
column has the default order value (0) and will be placed second.