Working with actions

Use actions to run procedures to get or push data, or initiate tasks in third-party systems.

Getting and formatting data

For example, the following series of actions enables a user to make a doctor's appointment:

Example series of actions

  • setDoctor sets a variable to store the doctor's name.
  • getDates makes a REST call to a third-party system to get a list of available doctors and dates.
  • formatDates processes the data into a format that can be used by the chatbot (using the Set Variable action type).

Using conditional logic to control the conversation flow

You can also use an action to add conditional logic to the chatbot and set the direction that the conversation takes based on whether one of the conditions is met.

For example, the following action defines three conditions that determine the next step in the conversation based on whether the user requests a brochure (and must therefore give their address details) or whether they request a phone call or demo:

Example series of actions 2

The conditions are defined like this:

Variable Operator Value Next
{nextStep} = Request brochure Provide Address
{nextStep} = Request demo Confirm
{nextStep} = Request call back Confirm

See also Example: using counters and conditions.

Going to another chatbot

You can use an action to move from an interaction in one chatbot to an interaction in another chatbot. This makes it easier to organize complex chatbots as you can then group more specialized interactions in separate chatbots. In the following example one chatbot determines the type of insurance quote, then uses Go to Bot actions to hand over to other more specialized chatbots.

Example series of actions 3