How to retrive the trigger only (not the entire sentence?)

(cirosan) #1

Hello,
here below there’s a simple example of the problem I’m trying to solve :slight_smile:

Let’s suppose I have 2 keywords as a trigger:
windows” and “ios

So the flow is also triggered if the user type for example: “I use windows

I would like to reply something like: “Do you use windows only”?
But for now, I’m only able to reply with “Do you use I use windows only”?
because the entire sentence (“I use windows”) is reported in the reply
by the variable {{win_mac.message}}

How could I solve this? :slight_smile:
Thanks in advance for your suggestions

#2

I do this through Dialogflow right now. (It’s not the only reason I use Dialogflow. There is a parameter to use the original keyword in the answer.)

But if you have the keyword as a trigger, and save as an attribute if that flow is triggered, can’t you include just the attribute that was triggered in the answer? So:

“I use windows”
Flow triggered
Set an Attribute “ostype” = “windows”
Reply = "Do you use {{ostype}} only?

Not sure if you need to Get the Attribute between setting it and using it in the reply. I seem to have issues in that area.

#3

is a reply to a question, i suppose.
Change your answer from text to choice with two items:Windows and Ios, in this way your flow is triggered with the single key and not a sentence

1 Like
(Karen Barker) #4

Hi @cirosan,

@CaosMkt’s suggestion is a great idea. :slight_smile:

Another option would be to use our Word or Phrase Grouping on your keyword triggers. Set your groups to [windows] or [ios] and then you can use {{win_mac.group}} within the message to give the correct variable. :slight_smile:

1 Like
(cirosan) #5

Thanks @KarenBarker I didn’t know about grouping! great feature :smiley:
Anyway I understand this is only possible to trigger a flow
Is it possible to have the same option into a flow?

For example, a flow is triggered by a negative sentence
I DON’T DRINK COKE

Then the flow starts asking:
SO, WHAT DRINK DO YOU LIKE?

The user could reply with many drinks in many different ways
but I’m just interested in the drink’s name
So, if the users writes:
ACTUALLY I LOVE SPRITE

I would like to reply something like:
DO YOU REALLY JUST LIKE SPRITE?!

Grouping would be great, but how to use it into a flow?
I tested it with a trigger and it works perfectly, but I have no idea how to do the same into a flow

Thanks!!!

@CaosMkt thanks for your suggestion, but when the options are 10-15
I don’t think it’s a good choice displaying buttons (in case of windows / ios yes of course)

(Karen Barker) #6

Hi @cirosan

Hmm…:thinking:

There isn’t really a way to do this within a flow at the moment I’m afraid.

Button choices are limited to a maximum of 10 options that you could give the user and in the case of drinks this definitely wouldn’t cover all choices. Another option with the Ask a Question service would perhaps be to word the question that the user should just answer with the name of the drink and then use a regex validation to ensure a 1 word answer is provided. :question:

(cirosan) #7

Yes @KarenBarker, it’s exactly what I’m saying
It’s impossible to show buttons in cases like this

I read your answer and I appreciate the ‘workaround’
So you’re saying that there’s no way that’s to use the grouping features into a flow?
(not to trigger I mean)

#8

Hi @cirosan,

you need to integrate a NLP service.

@stellarun1 suggested one of them in his reply

(Karen Barker) #9

@cirosan

Unfortunately no. The grouping can only be used on a trigger. :frowning2:

You would otherwise be looking at using an NLP service as has been suggested previously which would be able to derive the users intent. :thumbsup:

#10

Hi @cirosan,

read this FlowXO guide https://medium.com/flowxo/using-flow-xo-with-api-ai-86f59e24cda6
api.ai is now Google Dialogflow https://dialogflow.com/

(cirosan) #11

Wow this is amazing!!! Thanks for this link @CaosMkt!!!

I tried to follow the tutorial, but it’s not so easy,
since both software - FlowXO and DialogFlow - changed their interfaces and options!

In this moment I suppose that:

  • the api adress is https://api.dialogflow.com/v1/ (api v1)
  • “authorization” correspond to: “Bearer CLIENT_ACCESS_TOKEN”
  • “content-type” is not automatically added by FlowXO, but I typed “application/json”

Screenshot > https://www.screencast.com/t/aCbEPsOV

Anyway I don’t understand if I’m really querying DialogFlow because the ‘sessions’ (in dialogflow) are = 0
So I guess somerhing is wrong :frowning:

#12

Hi @cirosan,

i found this info about post request to query dialogflow:
https://dialogflow.com/docs/reference/agent/query#post_query