Slots

Slots are key/value pairs that function as your bot'sClosed A software application that handles customer interactions in place of a live human agent. memory. They hold data that can come from various sources, including contact utterancesClosed What a contact says or types. or your CRMClosed Third-party systems that manage such things as contacts, sales information, support details, and case histories.. You can use slots to: 

  • Personalize interactions between bots and contactsClosed The person interacting with an agent, IVR, or bot in your contact center.. For example, you can extract the contact's name using a pre-chat form, then use a slot during the interaction to have the bot call the contact by name.
  • Collect information to pass on to databases, other CXone applications, or third-party products. For example, you can collect the contact's updated address and update their customer record in your CRMClosed Third-party systems that manage such things as contacts, sales information, support details, and case histories..
  • Collect information from databases, other applications, or third-party products to pass on to the contact. For example, if the contact wants to check an account balance or the due date of a bill, you can retrieve that information from the appropriate system to share with the contact.
  • Create branches in the bot's conversations based on information provided by the contact. For example, if the contact wants to check an account balance, the bot's response might be different depending on which account the contact wants to check. If you extract the account type and save it in a slot, you can use the stored value as a condition to determine which branch the bot should take.

Slots and Entities

Slots are closely tied to entitiesClosed A piece of information gathered from the contact's messages during conversations with a bot. in your bot's configurations. The following table describes the relationship and differences between slots and entities. 

Criteria Entities Slots
Function

Define and extract specific pieces of information relevant to the conversation between bot and contact.

Hold information during an interaction.

Can be used as conditions to branch a conversation based on the value the slot holds.

Can be used as a variable in bot responses to inject the slot value into the conversation.

Source Contact utterancesClosed What a contact says or types.. Contact utterances, pre-interaction forms, databases, third-party applications, other CXone applications, Studio scripts.
Relationship Require slots. All entities have slots.

Do not require entities. Some slots hold data extracted from utterancesClosed What a contact says or types. via entities. Other slots hold data pulled from other sources.

Can be used as conditions to branch conversation paths. Can also influence the progress of the conversation in other ways.

Slot Data Types and Behaviors

There are five types of data that slots can hold. Each type behaves differently. The types are:

  • TextText slots hold text information. This includes numeric characters that don't need to be treated as numbers, such as a telephone or account number. A text slot can influence the bot's behavior simply by being empty or filled. The exact value of the slot doesn't affect the conversation.
  • NumberNumber slots hold numeric information that needs to be treated as numbers and not text. This type of slot can influence the bot's behavior. The exact value of the slot can change how the bot responds. You can set upper and lower limits for acceptable numbers. If the value that fills the slot is outside those bounds, the bot's behavior is different. You must train the bot to respond based on values that are in and out of the defined range.
  • CategoricalCategorical slots hold a defined set of text information. This type of slot can influence the bot's behavior. Depending on which of the defined values fills the slot, the bot can provide a different response.
  • BooleanBoolean slots hold true or false values. This type of slot can influence the bot's behavior based on whether it's empty, or if its value is true or false.
  • AnyThe any value slots can hold other types of values, including lists or JSON. This type of slot cannot affect the bot's behavior.

Each data type supports different options to configure the slot's behavior. The behavior defines how you can use the slot in a dialogue:

  • Influence the dialogue: All slot types except the Any type can influence the dialogue. You can use this to create branching paths in the conversation.
  • Intent restriction: You can limit the slot so the bot only fills it when the predicted intent matches the one configured for the slot.
  • Form restriction: You can limit the slot to fill only from a certain form.

You can learn more about each slot data type and how it's used on a different help page.

Slot Filling Methods

Slot filling methods are the different ways the bot stores values in a slot. Values come from different sources. When you set up a slot, choose the filling method that best fits how you plan to use the slot in conversations.

There are five methods of filling slots in CXone Bot Builder. They're described in the following table.

Filling Method Details
From System

System slots are created automatically when an interaction begins and filled as the interaction progresses. The system slots are:

System slots cannot be edited, but you can use them as variables in the interaction. However, they cannot influence the dialogue. Learn more about system slots.

From Entity

A slot is automatically created when you add an entity. The slot is filled with data extracted by the corresponding entityClosed A piece of information gathered from the contact's messages during conversations with a bot. during an interaction. Entity-based slots must be configured after you create the corresponding entity. This allows you to specify how the slot functions. When you delete an entity, the corresponding slot is also deleted.

You can use these slots as variables in the same interaction or in other areas of Digital Experience. Entity-based slots can hold any of the supported data types.

From Intent

Intent-based slots fill with a pre-defined value when the specified intent is recognized during an interaction. You can create these slots and configure them with one or more values and the intents that trigger them.

You can use these slots as variables in the same interaction. Intent-based slots can hold any of the supported data types.

For example, if you're asking a contact to subscribe to a newsletter, you can create a new slot called Subscription and add two intents to it. You can map the intent Agree to the value yes and the intent Deny to the value no. Depending on how the contact responds to the question, one or the other value fills the Subscription slot.

From Message This method fills the slot with the text of the contact's next utteranceClosed What a contact says or types.. Message-based slots can hold any of the supported data types.
Custom slots

Custom slots typically hold information based on business logic. An example would be data retrieved by an API call to your CRMClosed Third-party systems that manage such things as contacts, sales information, support details, and case histories. or another third-party application.

You can use the slot value as a variable in multiple interactions between bots and contacts, or in other areas of Digital Experience. Custom slots persist until they are manually deleted. They can hold any of the supported data types.

For example, you might use a pre-chat form that asks for your contact's account number. You could then pull the contact's account status from another system, and design your stories so that the bot always attempts to collect any past-due balance.

Slot Filling Restrictions

You can restrict slots so they only fill from specific intentsClosed The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish or forms. With restrictions in place, the bot only fills that slot when the intent or form matches what you define.

This is helpful if you only need to save slot values in certain circumstances. For example, you have a slot that holds the contact's name. You use this slot to update the contact's account. The name on the account needs to be a full, legal name. You want to ensure that this slot isn't used in other instances where the bot might collect a contact's name. To do this, you add restrictions to limit the slot to the form and intent used to collect the contact's full, legal name. If you want to use the contact's first name to personalize the conversation, you could create a second slot to hold the contact's first name, to be filled from a different intent or form.

Slot Variables

You can use slots as variables in the messages your bot sends to contacts. For example, you could: 

  • Collect the contact's first name and have the bot use it to greet the contact.
  • Have the bot confirm information or choices by repeating the information back to the contact.
  • Pass data to your CRM system to update contact records.

To add a variable, use this syntax: {slot_name}. If the slot contains a nested JSON object, you can access the values in the object using dot notation:  {slotName.parameter}.

The value the slot contains replaces the variable when the bot sends the message. You must ensure that the slot collects the correct value before using it as a variable during the interaction.

For example, if you want the bot to greet the contact with their first name, you would need a slot to hold the first name and a way to fill the slot, such as a pre-chat form. If the slot is contact_firstName, you would enter this text in the greeting message the bot sends: Hello {contact_firstName}!

Slots as Conditions to Branch Conversation Paths

You can use slots in storiesClosed Used to train bot for interaction handling based on intent and context and rulesClosed Used to define bot's response to messages that don't change with context. to create conditions that must be met before the bot can take that path. This allows you to create conversation paths that branch based on certain criteria. The criteria are based on the value that the specified slot holds when the conversation reaches the branching point.

You can use entites and their corresponding slots that appear in the contact's message as a condition, or you can use the Slot Condition bot action to use other slots as conditions. In either case, you need to create an intentClosed The meaning or purpose behind what a contact says/types; what the contact wants to communicate or accomplish for each possible path the bot could take. This teaches the bot how to respond based on the specific value saved in the slot.

Akela Wolfe, the Classics, Inc. Bot Builder administrator, is developing a bot to recommend books to contacts browsing the website.  She wants her bot to ask the contact what genre they like, then respond differently based on the answer.

She decides to use slot conditions. For her first attempt, she creates the following stories:

  • genre + mystery
  • genre + nonFiction
  • genre + literature

Each story starts the same: 

Contact: "Can you recommend a book for me?"

Bot: "I'd be happy to! What genre are you in the mood for?"

Contact: "A [genre] I think."

Akela needs an entity, so she creates one called genreType.  This automatically creates a genreType slot. The entity is a lookup type because genre is a category. Next, Akela adds some genre types as examples. She'll add more as she develops the bot.

In the genre + mystery story, Akela selects mystery in the contact response and chooses the genreType lookup entity. Bot Builder automatically adds the genreType slot under the contact response. The slot will fill with whatever genre the contact says.

Next, Akela adds the Slot Condition bot action. She chooses genreType as the Slot and sets the Value as mystery. She then adds a Message bot action with the message "Oh I love a good mystery! We have some great ones."

The next thing Akela does is add a script integration action that connects to the Classics eBook database. It pulls ratings data and generates a list of three highly-rated books in the mystery category and chooses one randomly. The others will be used in future stories to provide more options if the contact wants them.

Akela adds a Message bot action that says "I found a mystery you might like. Here's the first one." Then Akela adds a Rich Link action to display a link to the first title.

Finally, Akela repeats these steps for the genre + nonFiction and genre + literature stories.