I'm not sure about your question, but, if you want to return the mail address inside the conversation, you can add the mail
address value inside the context
variable [advanced response]:
{
"context": {
"mail": "mail@domain.com"
},
"output": {
"text": {
"values": [
"Your mail address is $mail"
],
"selection_policy": "sequential"
}
}
}
And use $mail
[method for access contexts variables] for access this value and return in your conversation something like:
if bot recognizes yourCondition response "Your mail address is $mail
But, if you want to use some custom code for that, you can add the return from your Conversation message call, something like:
//add inside your call, like:
conversation.message(payload, function (err, data) {
data.context.mail= "mail@domain.com";
if (err) {
return res.status(err.code || 500).json(err);
}
updateMessage(payload, data, req, res);
});
});
And in your Watson Conversation Service, you can use this variable inside every response message with $mail
.