Data Collection
This section shows what kind of forms can be defined in order to collect information from customer before starting a new contact.
Data Collection is organized in forms, for each service you can define multiple ordered list of forms to be rendered. The order of the forms is static, but we are planning to add the feature to make it dynamic based on data selected or to add conditional forms visible only under a condition.
Each form is composed of multiple fields. Possible fields type are:
text (can be generic or specialized)
nickname
email
name
surname
phone
date
textarea
checkbox
radio
select
Each type has the following properties:
Property | Description | Notes | Localizable |
---|---|---|---|
Name | Name used to identify the field | Â | Â |
Label | Label to be rendered in the UI | Can be localized. Accepts a string representing the label to be displayed or an object whose key is the country code and whose value is the relative label to be displayed. | X |
isMandatory | If true the field is required | A * is added in the UI | Â |
isVisibleCustomer | If false the filed is hidden | Mainly use for mode auto to fetch info using JS evaluation | Â |
isVisibleAgent | False if the content is not intended to be shown to agent for privacy reason | Â | Â |
isEditable | False if user is not allowed to change default value | Â | Â |
custom_regexp | Regular expression for validating input | If input is not validated, an error message is shown when submitting the form. Not used for textarea | Â |
customMandatoryErrorMessage | Error shown when a mandatory field is not filled | Can be localized. Accepts a string representing the label to be displayed or an object whose key is the country code and whose value is the relative label to be displayed. | X |
customValidationErrorMessage | Error shown when input is not valid | Can be localized. Accepts a string representing the label to be displayed or an object whose key is the country code and whose value is the relative label to be displayed. | X |
dc_type | Type of field | Supported values are:
| Â |
options | Object whose properties are used as possible values | Used only for radio, select and checkbox. Example: { | X |
value | field value | if mode is manual then it's considered as pre-filled value, if auto it's evaluted as a JS function returning a value | Â |
name | field name | Not visible in UI | Â |
mode | field mode | it describes how to use the value field. manual the value is used as default value, auto it's evaluated as a JS function | Â |
Â
It’s possible to find the complete description of the datacollection object structure in this page Data Collection Object
Examples:
Â
{
"id" : "f14cb974-eeb0-47e8-bd51-c3e32adb6a40",
"title" :{
"it-it" : "Anagrafica #3",
"en-gb" : "Registry #3"
},
"dc_mode" : "chat",
"next" : "",
"datacollection" : [
{
"dc_type" : "textarea", ---> new textarea data collection type
"label" : {
"it-it" : "Suggerimenti",
"en-gb" : "Tips"
},
"isMandatory" : true,
"isVisibleAgent" : true,
"isVisibleCustomer" : true,
"isEditable" : true,
"custom_regexp" : "",
"customValidationErrorMessage" : "",
"customMandatoryErrorMessage" : {
"it-it" : "Per favore, scrivi qualcosa",
"en-gb" : "Please, write something"
},
"value" : "", ---> contains the text typed by the customer or a default value if pre-filled
"name" : "customer_tips", ---> calldata variable name
"mode" : "manual"
},
{
"dc_type" : "checkbox", ---> new checkbox data collection type
"label" : {
"it-it" : "Che veicolo possiedi?",
"en-gb" : "What vehicle you own?"
},
"options" : { ---> checkbox values. The keys (bike, motorbike, car) will be the value returned by the selected checkbox. The customer will only see one label for each checkbox according the selected language.
"bike" : {
"it-it" : "bicicletta",
"en-gb" : "bicycle"
},
"motorbike" : {
"it-it" : "motocicletta",
"en-gb" : "motorcycle"
},
"car" : {
"it-it" : "automobile",
"en-gb" : "car"
}
},
"isMandatory" : false,
"isVisibleAgent" : true,
"isVisibleCustomer" : true,
"isEditable" : true,
"custom_regexp" : "",
"customValidationErrorMessage" : "",
"customMandatoryErrorMessage" : "",
"value" : "", ---> Contains the values selected by the customer separated by commas. Example: "bike,car". It can be prefilled to automatically select checkboxes.
"name" : "veichle", ---> calldata variabile name
"mode" : "manual"
},
{
"dc_type" : "radio", ---> new radio data collection type
"label" : {
"it-it" : "Frutto preferito?",
"en-gb" : "What's your favourite fruit?"
},
"options" : { ---> the logic is the same as in the checkbox field
"b" : {
"it-it" : "banana",
"en-gb" : "banana"
},
"a" : {
"it-it" : "mela",
"en-gb" : "apple"
},
"w" : {
"it-it" : "anguria",
"en-gb" : "watermelon"
}
},
"isMandatory" : false,
"isVisibleAgent" : true,
"isVisibleCustomer" : true,
"isEditable" : true,
"custom_regexp" : "pignatta",
"customValidationErrorMessage" : "",
"customMandatoryErrorMessage" : {
"it-it" : "Per favore, scegli un frutto",
"en-gb" : "Please, choose a fruit"
},
"value" : "", ---> Contains only one value selected by the customer. In can be prefilled to automatically select one value.
"name" : "fruit", ---> calldata variable name
"mode" : "manual"
},
{
"dc_type" : "select", ---> new select data collection type
"label" : {
"it-it" : "Scegli una macchina:",
"en-gb" : "Choose a car:"
},
"options" : { ---> the logic is the same as seen in the previous fields. In this example there is only one string value for each key that describe the car company brand (no localization required).
"audi" : "Audi",
"fiat" : "Fiat",
"renault" : "Renault"
},
"isMandatory" : true,
"isVisibleAgent" : true,
"isVisibleCustomer" : true,
"isEditable" : true,
"custom_regexp" : "",
"customValidationErrorMessage" : "",
"customMandatoryErrorMessage" : {
"it-it" : "Per favore, scegli una macchina",
"en-gb" : "Please, choose a car"
},
"value" : "", ---> conterrĂ il valore selezionato dal cliente. Se, ad es sceglie "Fiat", il campo sarĂ valorizzato con "fiat"
"name" : "manifacture", ---> nome della variabile che poi diventa di calldata (come prima)
"mode" : "manual"
}
],
}