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 this series of actions enables a user to make a doctor's appointment:

  • 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 bot. (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 bot and set the direction that the conversation takes based on whether one of the conditions is met.

For example this action defines three conditions which 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:

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 bot

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