Postback Object
In a custom form you can control what is posted back to Teneo when the form is successfully validated and submitted.
The data for the form fields is always posted back to Teneo as a URL encoded JSON string. It's value is assigned to a configurable request parameter but the default parameter name is "formData
".
To capture the formData
in Teneo you must validate that the request parameter exists on an inbound request and if so you should URL decode it's value and then attempt to parse it as JSON.
You can use the following code to retrieve the form data in Teneo:
JSON FormData Postback
This will show you an example of the format of the JSON that is returned in formData
for each of the available fields.
Property
Field
ageRange
Radio
userName
Input Field
bio
Text Area
favoriteRugbyTeam
Select
newsLetter
Switch
musicVolume
Slider
musicRangeVolume
Range Slider
agreedToTerms
Checkbox
skills
Combo Box
JSON Configuration for Postback Object
"postback": {}
See usage here
Property
Required/Optional
Default Value
Type
Notes
formDataUrlParam
optional
formData
String
The form data captured is put into a JSON object, URL encoded and added as a value to a request parameter with this name
userInput
optional
<empty>
String
Some text to enter into the chat after the user clicks submit. This text will be send back to Teneo as user input
confirmationAlert
optional
<empty>
String
If a value is entered then the user will see and information alert in the chat window with the configured message. No alert is shown by default.
Last updated