---
schema_version: "1"
id: 220edf88767a7ff1a65a3c00aae3ebaed9863a6c797fbcfd6517be6e19d10b4f
title: Schedule an Appointment with an Enhanced Bot
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/bots_service_enhanced_time_selector.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.bots_service_enhanced_time_selector.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b7c071f3d6acab21c1116d226c8349bfa3b3fe7e95044b2ddff56d8617cd8b02
description: Use the time selector messaging component with your bot to schedule appointments or deliveries within a bot conversation. The component works with an Apex class or flow to present customers with a selectable list of time slots and save their responses.
products:
  - Service Cloud
  - Service Intelligence
release: "264"
---
# Schedule an Appointment with an Enhanced Bot

Use the time selector messaging component with your bot to schedule appointments or deliveries within a bot conversation. The component works with an Apex class or flow to present customers with a selectable list of time slots and save their responses.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.einstein_service_intro.htm&amp;language=en_US" target="_blank">View supported editions</a> for Einstein Bots.</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.messaging_editions.htm&amp;language=en_US" target="_blank">View supported editions</a> for Messaging.</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d96534e64">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d96534e64 ">To build and manage Einstein Bots:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d96534e64 ">
              <p>Customize Application</p>
              <p>OR</p>
              <p>Modify Metadata</p>
              <p>OR</p>
              <p style="margin-bottom:0;">Manage Bots</p>
            </td>

          </tr>
        </tbody>
      </table>

Support for messaging components varies by channel.

Before you begin:

- From the Messaging Component page in Setup, [create a time selector messaging component](https://help.salesforce.com/s/articleView?id=service.messaging_components_time_selector.htm&type=5&language=en_US).
    
    When you set up a time selector, you create a prompt that instructs the customer to select a time slot. The prompt isn’t visible in the Bot Builder, but you don’t need to add a separate dialog step to send it. In the bot conversation, the prompt is sent to the customer when they reach the dialog step that references your component.
    
    You can view or edit the prompt from the Messaging Components page in Setup, in the Constants section of the Component Details page for your component.
- Create an Apex class or flow that dynamically generates session-specific choices each time the component is sent. In most cases, use an Apex class.
    - [Example: Apex Class for Time Selector Messaging Components](https://help.salesforce.com/s/articleView?id=service.messaging_components_apex_class.htm&type=5&language=en_US)

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/images/icon_note.png)

Note These instructions assume that you use a dedicated Apex class or flow to populate the messaging component. But you can use variables from anywhere in your bot, as long as they’re of the same object type specified in the messaging component.

1. To generate a list of available time slots each time the component is sent, add an Apex class or flow to your dialog.
    1. Go to the Bot Builder. Click **Dialogs**, and then select the dialog that you want to add the time selector component to.
    2. From the Dialog Component Library, drag the **Apex** or **Flow** action dialog step onto the canvas.
    3. In the Step Properties panel, select the Apex class or flow associated with the time selector component.
    4. For each output, create or select a bot variable to store the output of the Apex class or flow. You reference these variables again in the Time Selector dialog step to show available time slots and other information to the customer.
2. Add the time selector component to your bot.
    1. From the Dialog Component Library, drag the **Time Selector** dialog step onto the canvas.
    2. In the Step Properties panel, select the time selector component associated with your Apex class or flow.
    3. To show available time slots and other information with the component, for each input parameter, specify a bot variable. In most cases, specify the same output variables you created in the previous Apex or Flow action steps in the corresponding input parameter fields.
        
        For example, in an Apex action step, you store the output of the Messaging Time Slot Options Apex class in the Available Times object list variable. In the associated Time Selector dialog step, in the Time Slot Options input parameter, you specify the same Available Times object list variable.
        
         
        | Apex dialog step | Time Selector dialog step |
        | --- | --- |
        | ![An Apex action dialog step with the AvailableTimes object list output variable](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_enhanced_time_apex.png) | ![A Time Selector dialog step with the AvailableTimes object list variable used as input](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_enhanced_time_selector.png) |
    4. Specify a backup rule action for the bot to use if the required input parameters don’t return any time slots to show to your customer. Select **Call Dialog** or **Redirect to Dialog**, and then select the appropriate dialog.
    5. In the output section, select or create an object variable to store the customer’s choice.
        
        ![An object output variable](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_enhanced_time_output.png)
    6. Tell the bot what to do if the variable already contains a value. The bot can keep the original value and skip the time selection, or the bot can prompt the customer to select a time and override the original value.
    7. Optionally, add repair attempts to prompt the customer to try again if the bot doesn’t recognize their response (for example, if the customer enters text instead of selecting an available time). In the Repairing Misunderstanding section, include one or two repair attempts.
        
        ![A repair attempt instructing the customer to select from the available times](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_enhanced_time_repair.png)
        
        After the bot makes these attempts, tell the bot how to resolve the issue. Specify whether the bot repeats the repair attempts until the customer selects a valid choice or moves on to the next dialog step without filling the variable.
3. Optionally, add a Message dialog step to confirm the customer’s time slot selection. To include the specific time slot in the message, use standard merge syntax to reference the output variable you specified in the Time Selector dialog step.
    
    ![A message step that includes the output variable in merge syntax](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_enhanced_time_message.png)
4. Save your changes.

#### See Also

- [Compare Messaging Channel Capabilities](https://help.salesforce.com/s/articleView?id=service.livemessage_managed_package_lex_differences.htm&language=en_US)
- [Considerations for Messaging Components](https://help.salesforce.com/s/articleView?id=service.messaging_components_considerations.htm&language=en_US)
- [Considerations for Messaging Components in Enhanced Bots](https://help.salesforce.com/s/articleView?id=service.bots_service_enhanced_considerations.htm&release=264.0.0&type=5 "Carefully review these considerations before setting up Enhanced Bots.")