Skip to main content

Custom fields

Deprecated

caution
Configuring custom fields via $response has been deprecated since version 1.10.10. Use $analytics.setSessionData to add custom fields in session reports instead.

The export of custom fields from the $response object is available in dialog analytics. The content of these fields is exported together with dialog logs.

Syntax

Specify an object for exporting in $response, for example in the following format:

$response.<object name to be displayed in the exported data> = $<exported object>

For example:

$response.messageText = $parseTree.text;

Here messageText is the object name, $parseTree.text is the exported object.

Export

Navigate to the Analytics project section. In the Response Data Json Path field specify the object name; for the above example this is messageText.

tip
To add more data fields for exporting, click add more and specify the name of another object for exporting.

To export logs, on the Sessions tab click Session log.

Use in a script

  • Exporting for telephony: here digits dialed by the client in the tone dialing mode are exported.
patterns:
$Digits = $regexp<d+>

theme: /

state: Main
q!: * start
a: Dial 4 digits in the tone dialing mode
script:
$response.replies.push({
type: 'dtmf',
max: 4,
timeout: 15000
});

state: Digits
q: $Digits
a: you dialed {{$parseTree.text}}!
a: Thanks! Goodbye!
script:
$response.replies.push({
type: 'hangup'
});

$response.dtmf = $parseTree.text;

state: NoDigits
q!: *
event: noDtmfAnswerEvent
a: You have not dialed a number!
go!: /Main
  • Client data export: add postprocessing to the script and export the content of $client along with the dialog logs.
init:
bind("postProcess", function($context){
$context.response.client = $context.client;
});

theme: /

state: Authorisation
q!: * *start
script:
$session = {};
$client = {};
$client.lastName = "Bruce";
$client.name = "Wayne";
$client.patronymic = "Thomas";
a: Hello! Am I speaking to {{$client.name}} {{$client.patronymic}} {{$client.lastName}}?

Specify the fields to be exported:

fields to be exported

View the configurable fields for the session

The Dialogs section for sessions displays custom fields specified in Response Data Json Path.

Specify the custom fields > click Apply.

In the Sessions table the values of the specified custom fields will be displayed along with the search results for each session.

fields in the dialogs section to be exported

The field values are also displayed in the session data block, if you opened the session page from the search results in the Dialogs section where the custom fields have been specified in Response Data Json Path.

caution
The custom field values that are current for the last phrase in the session are displayed.