Customizing choices list for "Did you mean?"


(Deepanshu Jain) #1

When platform suggests list of choices out of available tasks, we can now customize standard response by applying following code.

Go to NLP > Standard Responses > Search for “Did you mean” go to choices. Apply below template for Web / Mobile Client.

I used button template for eg. you can use any available templates or custom template.

var info =getChoices() ;
var message = {
“type”: “template”,
“payload”: {
“template_type”: “button”,
“text”: “Did you mean”,
“subText”: “You can now customize response for did you mean”,
“buttons”: []
}
};
for (i = 0; i < info.length; i++) {
var button = {
“type”: “postback”,
“title”: info[i],
“payload”: “payload1”
};

message.payload.buttons.push(button);
}
print(JSON.stringify(message));


(Subrahmanyam Donepudi) #2

Thanks @deepanshu.jain for sharing this. To add up to this, developer could fetch the ambiguous list using the function getChoices(), meaning, developer will need to use the javascript editor over the standard editor at the channel specific override.

If the standard responses at ambiguous list are updated by developers at the standard editor, the ambiguous list will not be presented to the user.

@swathi.vadlamani Fyi


(swathi vadlamani) #3

Thanks for posting this @deepanshu.jain