Building and testing intelligent agents is key to delivering great experiences. However, thoroughly vetting your agent’s behavior across different scenarios can be a challenge. Manually providing specific contextual information, like the current app, record page, or user data for each test run in Agent Builder, is often tedious and time-consuming. Without this precise context, it can be difficult — if not impossible — to see how your agent will behave under specific scenarios and conditions.
This is where Preview Conditions in Agent Builder comes in. With preview conditions, you can define the exact environment that your agent needs for a specific test, directly within the builder, before you type a prompt. You can set details, such as the Salesforce app and page type that your agent is interacting with, the specific record it should focus on (like a Contact or Case), or even crucial customer-specific variables like language, email, or member ID for service agents. This setup simulates the live operational context right from the start of your test session.
Want to see this process, step-by-step? Watch the video above, where we demonstrate how to use preview conditions to test and develop both an employee agent and service agent.
About the author
Charles Watkins is a Lead Developer Advocate at Salesforce. You can find him on LinkedIn.