The flow :
User: Hi.
Bot: Spell the characters.
User: joh.
Bot: continue.
User: ny.
Bot: continue.
User: thats it.
Bot: Thank you ,johny(joh+ny)
Here, how can I store all the uservalues into a variable and merge them and display to user?I tried using context. I created a globalparameter context that has the values displayed.
For this,I have created 2 intents
First intent: firstnameletters Second intent: Thank you
In Firstintent,
const first_name_letters = async (df,globalParameter) =>{
let name=df._request.queryResult.parameters.alphabets;//slot values like joh
df.setResponseText(("name").replace("name",name).split('').join(' ')+"\n\n"+"continue");
}
The code below when I print globalparameter:
const first_name_letters = async (df,globalParameter) =>{
console.log("globalparametr ",globalParameter);
let name=df._request.queryResult.parameters.alphabets;
console.log("alphabets",globalParameter.alphabets);
}
//output of global parameter when I pass "suchi" in the DF console.
globalparametr {
alphabets: 'suchi',
reqIntent: 'first_name_letters',
languageCode: 'en',
'alphabets.original': 'suchi'
}
alphabets suchi
//output of globalparameter during next time when I pass "itra"
globalparametr before {
alphabets: 'itra',
reqIntent: 'first_name_letters',
languageCode: 'en',
'alphabets.original': 'itra'
}
alphabets itra
Now,I want to combine "suchitra" and want the bot to display "Thank you suchitra" in the thank you intent.
As confirmed by @lakshmi, to be able to combine the user inputs in an ongoing conversation you can:
name
in a list every time the user provides an input.