You can create a bot response flow by combining auto-responders.
This document explains how to get a survey with a bot response (updating a contact with a bot response).
1. Start a questionnaire
Start a survey triggered by the message "Answer Survey" sent by a friend. Create a new auto-responder and specify "Text" as the Type and "Matches Survey" as the Keyword.
Then, in "Response Content / Script", write the JSON code to send the selection button. (For the specifications of JSON code, please refer to "JSON Message".
{
"type": "flex",
"altText": "Q1. What is your occupation?",
"contents": {
"type": "bubble",
"body": {
"type": "box",
"layout": "vertical",
"spacing": "sm",
"contents": [{
"type": "text",
"text": "Q1. What is your occupation?",
"flex": 0,
"weight": "regular",
"wrap": true
}]
},
"footer": {
"type": "box",
"layout": "vertical",
"spacing": "sm",
"contents": [{
"type": "button",
"action": {
"type": "postback",
"label": "office worker",
"data": "office worker",
"displayText": "office worker"
},
"style": "primary",
"color": "#1c1b1b"
},
{
"type": "button",
"action": {
"type": "postback",
"label": "public servant",
"data": "public servant",
"displayText": "public servant"
},
"style": "primary",
"color": "#1c1b1b"
},
{
"type": "button",
"action": {
"type": "postback",
"label": "independent business",
"data": "independent business",
"displayText": "independent business"
},
"style": "primary",
"color": "#1c1b1b"
},
{
"type": "button",
"action": {
"type": "postback",
"label": "other",
"data": "other",
"displayText": "other"
},
"style": "primary",
"color": "#1c1b1b"
}]
}
}
}
2. Answer Responses
Create an auto-responder to respond to the answer choices. Create a new auto-responder and specify "Postback" as the Type and "Matches Company Employee, Government Employee, Self-Employed, Other" as the Keyword.
In the aforementioned JSON, the action
{
"type": "button",
"action": {
"type": "postback",
"label": "office worker",
"data": "office worker",
"displayText": "office worker"
},
}
This is specified as
When you tap the "office worker" button, the postback data "office worker" will be sent to LITTLE HELP CONENCT. Set the received data to the property.
Set "Job Title" to "Update Property Value" and set any response message to "Response Content / Script".
This completes the configuration. Don't forget to check the "Enable this auto-responder" box.
Send the text "Answer survey" to the official LINE account to see how it works. If the contact's properties are updated by answering the choices, your settings are successful.
Next: Merge contacts by bot response