How can I override that with my custom logic?

(Alexander Prismotrov) #1

Hi! Great solution! Several questions appeared.

  1. Can I somehow override FlowXO and DialogFlow interaction logic? For example, I need to separate text into parts before sending to DialogFlow (maybe add some other text preprocessing as weill), send several requests to DialogFlow and after I get DialogFlow results handle with my custom logic? How it can be done?

  2. How add my custom button handler to bot? For example, I want to add handler, which will send the chatlog to user email.

(Daniel Beckett) #2

The Text service could be used to split text into small parts. There’s also some other options for finding matches etc. that could help.

When your user answers questions the data is stored as an output that you can insert into other actions. This means that you can collate all of the user’s answers into a send email action to build the chat log.

Here’s a very basic example I’ve put together, it simply asks the user two questions and emails the answers:

There’s a catch-all setup to trigger the flow and then two questions.

I’m making use of the Messaging service but for emailing there’s also Gmail & SMTP (Outbound Email) available for more functionality.

The outputs are noted by the surrounding {{ }} and are selected by using clicking on the ‘xo’ icon when editing an action.

(Alexander Prismotrov) #3

Oh great answer! Still one question - is there action, where can I add my custom logic to user input text (for example before sending it to DialogFlow)?

(Daniel Beckett) #4

Sorry - not quite sure what you mean by that :thinking:

What type of custom logic are you looking to add?

(Alexander Prismotrov) #5

I mean can I send user input to my API endpoint, get the result and send it back to user?

(Daniel Beckett) #6

The Webhook service can be used to send data to an external API and also to receive back data from external API’s. Once you’ve got the data back in your flow it can be sent out to the user.

The following tutorial has an example of using data from an API and outputting it to the user:

Hope that helps :slight_smile:

1 Like