Update contacts by bot response

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).

Image from iOS-3

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.

1-Oct-17-2021-06-14-33-60-AM

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-Oct-17-2021-06-35-03-78-AM

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.

3-Oct-17-2021-06-51-18-89-AM

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".

4-Oct-17-2021-06-45-20-12-AM

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.

Image from iOS-3

5-Oct-17-2021-06-54-33-94-AM


Next: Merge contacts by bot response