cancel
Showing results for 
Search instead for 
Did you mean: 

Differentiate between a user typing and Postback button statements

0 Kudos
236

Dear Colleagues, I have a SAP Conversational AI Skill-based bot, and I am trying to create a different Chatbot action between when

- the intent is triggered because the user typed something (e.g. I want product documents about product X).

- the intent is triggered because the user clicked on a Postback button that activated the intent (e.g. click on the button "product documents product X").

I cannot find anything in the JSON code that differentiates these 2 behaviors to be used in the skill conditions: would anyone know of a way to do this? (just as a clarification: skill-trigger buttons are not an available option in this case).

Thank you in advance for any help you can give us

View Entire Topic
Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Just curious -- what different action are you taking?

As for the issue, I wouldn't expect any differentiation since essentially the user or the button are doing the same thing. I imagine you could try:

  • On the postback, add some code to the text that get's understood as an entity, and then you could check for that entity.
  • Add something to memory before offering the postback buttons (this I can see is not a really good solution in cases where the user ignores the button and simply types).
0 Kudos

Hi Daniel, thank you for your questions: let's go in order

  1. What different action are you taking? A: if the user clicks the button I ask to type the question, but if the user has directly typed it, I would like to avoid asking to type it a second time (it's not the end of the world but if I can avoid it it's better form a conversation flow POV).
  2. Add something to memory before offering the postback buttons. A: that's the problem, because the value is going to be in memory regardless of whether the user types or clicks.
  3. On the postback, add some code to the text that get's understood as an entity. A: now this is very interesting (to be 100% precise, you mean code, not simple postback text correct?). How would you do this?
mberghoefer04
Advisor
Advisor
0 Kudos

Hi Daniel, if there's nothing in the available structures in Memory that determines whether a button was clicked, the only possible - but not perfect - solution could be to put all the previous buttons' postback-value into an array and on every statement coming in checking whether nlp.source is found identically in that array. but there's two problems with that:

- the user could have typed exactly the same string as one of the postback-values

- (even worse:) buttons do not disappear, so the user could scroll up and push a button from a message from three days ago (teams!), and you probably would not want to build an array with all the postback-values ever offered.

i would agree with Giacomo, it would be great if we could access information about events, like which button in which message was clicked and so on...

regards

matthias