Travel assistance issue - Not able to print question

I have created travel assistance as per Docs.but facing issue in Select flight “Please provide the flight number.” entity. Bot is not asking this question and directly jumping to msg node

Hi @sachin ,

Thank you for reaching out to Kore.ai Community.
Please refer to the below documentation and check the configurations made on your bot.

Thank you,
Srujan Madderla
Kore.ai Community Team

@srujan.madderla i have refereed same Document but not able to resolve issue please help me on this

Hi Sachin,

Could you please share the bot access to koresupport@kore.com ?
we will try to analyse from our end and provide you an update.

Thank you,
Srujan Madderla
Kore.ai Community Team

@sachin
Can you please elaborate more on the complete code that you have written in the web/mobile client channel override for the entity prompt?

@swagata.sengupta I have followed as per Docs

var data = context.Fetchflightdetails.response.body.details;
context.flights = ;
context.info;
var msg;
for (var i = 0; i < data.length; i++)
{
if (context.entities.Preference == data[i].Type)
{
var details = {
“Airlines” : data[i].Airlines,
“FlightNo” : data[i].FlightNo,
“Airport” : data[i].Airport,
“AirportName” : data[i].AirportName,
“Time” : data[i].Time
};
context.flights.push(details);
}
}
var message = {
“type” : “template”,
“payload” : {
“template_type” : “quick_replies”,
“text” : “Here are the flights " + context.entities.Preference + " details for Los Angeles International Airport today. Please select the flight number to see details”,
“quick_replies” :
}
};
for (i=0; i < context.flights.length; i++)
{
var replies = {
“content_type”:“text”,
“title” : context.flights[i].FlightNo,
“payload” : context.flights[i].FlightNo
};
message.payload.quick_replies.push(replies);
}
return JSON.stringify(message);

@sachin
Seems like a Typo in the code. I have asked the documentation team to change this.

Please use

print(JSON.stringify(message));

instead of return JSON.stringify(message);

@swagata.sengupta still facing same issue instead of asking “Please provide the flight number.” SelectFlight entity its directly jumping to Msg Node

@sachin
Please add koresupport@kore.com and swagata.sengupta@kore.com in your workspace and then on your bot as developers. Will check this out.
Please post here the workspace name and the bot name once you are done.

One thing for you to know - If you have an ‘All’ channel message (Please provide the flight number.) and Web/Mobile channel override (The JS code in question here), while testing the bot, the Web/Mobile channel message - 'Here are the flights " + <<context.entities.Preference>> + " details for Los Angeles International Airport today. Please select the flight number to see details… will be preferred by the Platform.

Also, in the same flow, unless you use “discard” or “discard all” (these flush the current context), once an entity has been populated/selected, it will not ask for that again and it may go past it to the next nodes in the flow.

@swagata.sengupta I have invited you

@sachin
Observed that the template quick_replies array was empty.

Analysis:

The response from the API is

The preference entity values are “Arrivals” and “Departures”.

In the next Entity node:
if (context.entities.Preference === data[i].Type) statement compares “Arrivals” with “Arrival”. Since no match is found it is not finding anything to add to the array for “quick_replies”.

Resolution:
Changed the Preference entity values to Arrival or Departure

1 Like

The doc is now updated.

1 Like