Understanding the Requirement
Teams running Agentforce projects often need to provide a more interactive experience for their customers. This can be achieved by presenting custom buttons that invoke specific actions, such as opening a chat window or summarizing a lead.
We have seen that clients may want to display a set of buttons on the record, allowing the agent to display these as sample prompts that the user can click or not. For instance, a ‘Summarize this Lead’ button can be created, which invokes an agent action and writes a summary on the lead record.
Implementing the Solution
To implement custom buttons in Agentforce conversations, you need to use Custom Lightning Types. This allows you to create custom components that can be used to display buttons and invoke specific actions.
The root cause of the complexity in delivering custom buttons lies in the need to balance the agent’s ability to display sample prompts with the customer’s expectation of an interactive experience.
By using User Utterance Examples, you can suggest sample prompts that the agent can display as clickable buttons. The agent can then use these prompts to invoke specific actions, such as opening a chat window or summarizing a lead.
example.code
// Example code snippet using Custom Lightning Types and User Utterance Examples
Best Practices and Next Steps
When implementing custom buttons in Agentforce conversations, it’s essential to consider the user experience and the agent’s workflow. You should discuss with your client what buttons they always want to see on the record and create them as custom buttons on the page that invoke an agent action.
Checklist for Implementing Custom Buttons
- Use Custom Lightning Types to create custom components
- Use User Utterance Examples to suggest sample prompts
- Discuss with your client to determine the required buttons and actions
- Create custom buttons on the page that invoke an agent action
- Test and refine the implementation to ensure a seamless user experience
Can the button open the chat window to continue the conversation?
Yes, the button can be configured to open the chat window and continue the conversation.
How do I create custom buttons on the page?
You can create custom buttons on the page by using Custom Lightning Types and configuring the button to invoke an agent action.
What is the role of User Utterance Examples in custom buttons?
User Utterance Examples are used to suggest sample prompts that the agent can display as clickable buttons, allowing the customer to interact with the conversation.
How do I test and refine the implementation?
You should test the implementation with your client and refine it based on their feedback to ensure a seamless user experience.
Need help shipping this in production?
Genetrix builds and untangles Salesforce Marketing Cloud and Agentforce setups for teams that want it done right the first time. If anything in this post sounds familiar, talk to us before it ships.