How to resume from a previous question

Hi,
we need to give a message to the customers after their first question but before answering,
and then, using buttons, resume from the first question:

EX:
Customer: my balance
Assistant: before answering, here’s an important message: ******
Do you want to know more?
Yes
no
Continue with my question

and by cliccking on the last button the conversation will resume from “my balance”.

If the customer click yes, we need to show another output with the “Continue with my question” button ( this will also resume from “my balance”).

How can we achieve this?
may we also quote other questions with items like “userInputText”?

Thank you.
Simone

1 Like

Hi Simone (@Simon),

interesting use case. Maybe I can ask you for some more details.
Do you want to implement the described experience only for the mentioned “my balance” flow? Or are we talking about automatizing this behaviour for a higher number of flows?

And regarding your last question around the userInputText, the Teneo Engine Scripting API offers a number of interesting functions, maybe getUserInputText() is the one you would like to use. If your idea is to replace the button label of “Continue with my question” though with this text, then I would say you need to do this in a more controlled way, like a mapping of the intent towards a button label value somewhere before. Is that what you would like to do? If you had a bit more context also on this one, that would be great :slight_smile:
Thanks,
/Benjamin

Hi,
for the first case we need it to be on all flows,
but this as already been done with a conditioned prompt trigger, we miss an item that may store the first question for later use;

We know that function like LastUserInputText exisist but in the provided example will not work in case the customer will click on Yes or No ( because LastUserInputText will become yes/no).

For the last question, the label is not a problem, is more like:

Customer: question 1
Assistant: answer 1
Customer: question 2
Assistant: answer 2
Customer: question 3
Assistant: answer 3

Customer: what was my second question?
Assistant: your second question was question 2
(in the KB this will be something like
“your second question was SecondUserInputText / ${sSecondInput}”)
is this possible?

Is there a list of function like getUserImputText / getDialogHistoryLength etc…?

thank you.
Simone

Hi Simone, (@Simon)

please take a look at the following page for an overview on the Teneo Engine Scripting API: EngineAccess (Teneo Engine Scripting API)
You have there the function that you mentioned before, getUserInputText(), which you can call in different places within a Teneo interaction, in an appropriate script use:
_.getUserInputText()
You could store then the required user input in an additional variable.
Does that work for you? If there are further questions, please let me know :slight_smile:
/Benjamin

Hi, We’ve tried to store a variable:

sQuestion = _.userInputText

but it keeps on getting updated to the last input/question so, as the above example, the answer is:

[…]

Customer: what was my second question?
Assistant: your second question was question 3

how can we put a stable value for variables like:

sQuestion1
sQuestion2
sQuestion3
Etc…

Thank you regards

Hi @Simon ,

the call to the function getUserInputText() will always return you the user input of the current interaction with your bot. You can assign the value of your global variable though then to “pass through” the previous user input and store it in a different global variable.
For example, in Pre-Processing

sPreviousUserInput=sLastUserInputText;  //assign previous value here
sLastUserInputText=_.getUserInputText(); // current user input

I’m not sure though if this is really required for the user experience you want to achieve. Maybe a Resume Prompt could be an idea. I will write you a direct message, and maybe we can take a quick look together at your flow. :slight_smile:
/Benjamin