Set Up a Dialog
- From the Bot Builder menu, click Dialogs.
- In the Dialogs panel, click the dialog that you want to set up and click | Edit.If you don’t have any dialogs yet, see Add a Dialog.
- To add an element to the dialog, click to display the element palette. Then click the element that you want to add.Add any of the following elements:To send a message from the bot to your customer, click Message to add a Message element to the dialog. Then enter the outgoing message from your bot to the customer.Start the conversation between your bot and your customers with a friendly message that identifies the bot. For example, “Welcome! I’m Service Bot.” You can add a menu after the message or redirect the customer to the main menu.To gather information from a customer, click Question to add a Question element to the dialog. Then enter the question from your bot to the customer (1) and select the slot to store the answer (2). Use Choices to present buttons or menus that let your customer answer questions quickly (3). Create static choices manually or generate dynamic choices based on the output of a selected action. If you select Recognize and save the answer from customer input, the bot skips this question if it can detect the answer from the customer input that triggered the dialog (4).To create, read, update, or delete Salesforce objects, retrieve data and display it to the customer, retrieve external data from a third-party API, or start a flow, add an Action element to the dialog. Then select the action to perform. Apex classes with invocable methods are available for selection.Note To give your bot access to Apex and Salesforce objects, update sfdc.chatbot.service.permset. See Setting Apex Class Access fromPermission Sets and Working with Object Settings inPermission Sets.Use Rules to specify the conditions that start any of the following actions: call a dialog from within the current dialog, redirect to a different dialog, clear a slot value, transfer to an agent, and save information from fields in prechat forms to specified slots. Add a Rules element to the dialog. Then define the conditions (1) and rule actions (2).NoteFor the best experience for your customers, we recommend that you incorporatepre-chat information gathering into the conversational design of your bot.If you use Live Agent and Omni-Channel routing, you can use the pre-chat ruleaction to access custom fields on the Live Agent transcript object that are set bypre-chat APIs.Drag dialog elements to change their order in the dialog.
- To send a message from the bot to your customer, click Message to add a Message element to the dialog. Then enter the outgoing message from your bot to the customer.Start the conversation between your bot and your customers with a friendly message that identifies the bot. For example, “Welcome! I’m Service Bot.” You can add a menu after the message or redirect the customer to the main menu.
- To gather information from a customer, click Question to add a Question element to the dialog. Then enter the question from your bot to the customer (1) and select the slot to store the answer (2). Use Choices to present buttons or menus that let your customer answer questions quickly (3). Create static choices manually or generate dynamic choices based on the output of a selected action. If you select Recognize and save the answer from customer input, the bot skips this question if it can detect the answer from the customer input that triggered the dialog (4).
- To create, read, update, or delete Salesforce objects, retrieve data and display it to the customer, retrieve external data from a third-party API, or start a flow, add an Action element to the dialog. Then select the action to perform. Apex classes with invocable methods are available for selection.Note To give your bot access to Apex and Salesforce objects, update sfdc.chatbot.service.permset. See Setting Apex Class Access fromPermission Sets and Working with Object Settings inPermission Sets.
- Use Rules to specify the conditions that start any of the following actions: call a dialog from within the current dialog, redirect to a different dialog, clear a slot value, transfer to an agent, and save information from fields in prechat forms to specified slots. Add a Rules element to the dialog. Then define the conditions (1) and rule actions (2).NoteFor the best experience for your customers, we recommend that you incorporatepre-chat information gathering into the conversational design of your bot.If you use Live Agent and Omni-Channel routing, you can use the pre-chat ruleaction to access custom fields on the Live Agent transcript object that are set bypre-chat APIs.
- When the bot finishes a dialog, it can wait for customer input, show a menu of options, start another dialog, or transfer the customer to an agent. Tell the bot what to donext.Note Each menu item is a dialog. You can build a menu to display or display the Main Menudialog.
- Save the dialog.