.matches('Note.Create', [(session, args, next) => {
// Resolve and store any Note.Title entity passed from LUIS.
var intent = args.intent;
var title = builder.EntityRecognizer.findEntity(intent.entities, 'Note.Title');
var note = session.dialogData.note = {
title: title ? title.entity : null,
};
// Prompt for title
if (!note.title) {
builder.Prompts.text(session, 'What would you like to call your note?');
} else {
next();
}
},
(session, results) => {
var note = session.dialogData.note;
if (results.response) {
note.text = results.response;
}
.
.
.
}])
In the above code, when the user asks What would you like to call your note?
. The responses from the user can be like My Note Title
or i would like call my note **My note Title**
or Let us call it **My Note Title**
.
So the question is how to extract/get only My Note Title
out of the response to the Prompts
.
It is currently storing the whole response in note.text = results.response;