Start flow through a web input

(Gino Gentile) #1

Hi, how are you?

This is my doubt, i want start a flow when a user enter in my web and answer a input question, like:

and take that value to start a flow.

This is possible? how?

Thanks

(Karen Barker) #2

Hi Gino,

What platform are you building your bot on?

We support passing reference data to both Facebook messenger and the Web Messenger on the URL. Your flow would require a catch-all trigger, but the value passed on the URL will be stored in the metadata and therefore you could launch different flows based on that or use the value passed within the flow. :thumbsup:

(Gino Gentile) #3

Hi Karen,

sorry, im building for web messenger.

Exist some tutorial to do this?

Thank you

(Karen Barker) #4

Hi @Gino_Gentile,

Unfortunately there isn’t a tutorial for doing this.

When you look in your bot settings for you web messenger you are given 3 options.

The first of these is a URL in the form of https://fxo.io/m/xxxxxxx You could add this URL to the onclick of your search button on the website and send the destination as reference data something like: https://fxo.io/m/xxxxxxx?destination=dest. This will open the web messenger in a new window as a full screen messenger.

The second option is to embed the web messenger as an iframe in your webpage. It could be hidden until the user clicks the search now button at which point you could load it and pass the destination in the same way as option 1.

The 3rd option is to use the widget code, however this wouldn’t allow you to trigger the bot on the user clicking the “search now” button.

Once you have set up this you’ll need to trigger a flow.

A new user who opens the bot will trigger a “start” message. You could therefore set up either a catch-all flow or a keyword flow on the message start which will then automatically trigger a flow when the bot opens. This flow will have the destination the user entered then stored in the trigger metadata and can be accessed in future actions in the flow by using the Flow XO icon on the right hand side of input fields.

Exactly how this flow would look depends on what you want displayed to the user. You could for instance do a database lookup for holidays with the value stored in the metadata and return these back to the user.

1 Like