my platform is web/mobile client. in this i am using to send a welcome message when bot connects.
In this scenario i am sending 2 buttons.i am having button template but now here is the twist that button text is “abc” and onclick to the button, text is also sending as “abc”. i want to send another text like :- “something” on clicking to button containing text “abc”.
Is it possible???
If you use the standard button template for our web/mobile client channel,
The payload is what is sent back to the platform. Title is what is displayed to user.
var info = ["Button1", "Button2", "Button3"];
var message = {
"type": "template",
"payload": {
"template_type": "button",
"text": "Button Template Label",
"subText": "Button Template Description",
"buttons": []
}
};
for (i = 0; i < info.length; i++) {
// if the button is to send back text to platform
var button = {
"type": "postback",
"title": info[i],
"payload": "payload1"
};
/* Uncomment this if the button is to redirect to url
var button = {
"type":"web_url", // type can be "postback" if
"url":"URL_TO_REDIRECT",
"title":buttons[i]
};
*/
message.payload.buttons.push(button);
}
print(JSON.stringify(message));
so whatever payload i am sending to the bot onclick of the button , i want to show the same on UI, how could i proceed with that??
I suggest you to have same display (title) and payload. But you said you want to send a different text than title. Once user clicks the payload, you can have a message node after that to show what value of entity you received.
@pbradraj111
Imagine you want to display user names like “Ashish”, “Mohan”, “Yakub” and you have payload values of “emp_1232_56876435”, “emp_1232_56876436” and “emp_1232_56876437” as payload so that platform can use the code to call some next service node.
Do you think it will be a good user experience to show the payload?
It is working as designed for a good user experience.
I got you it will not be a good user experience but atleast there should be a way where i can send another text and it should be visible from user bubble.
is there any flexibility??
It will not show in the chat conversation (it is both a bad user experience and a potential security issue). You can display the value of entity you captured in next node if you want to.
context.entities.
