Contact Us

April 22, 2024

May 15, 2026 8:52 am

Creating an Employee Agent to Answer Salesforce Data Questions in Slack

Share with

Understanding the Requirement

The requirement is to create an employee agent that can answer questions about Salesforce data, such as listing opportunities for a specific account, and integrate it with Slack. To achieve this, we need to create a data graph and a prompt template that can retrieve the required data from Salesforce.

Setting Up the Data Graph

To set up the data graph, we need to create a new data graph with the Account object as the root. This will allow us to retrieve data related to accounts and their associated opportunities.

Creating the Prompt Template

Once the data graph is set up, we need to create a prompt template that can retrieve the required data. We will use field mapping to map the fields in the prompt template to the fields in the data graph.

Prompt Template Code

/* Sample prompt template code */
var accountName = "{{accountName}}";
var opportunities = DataGraph.query("opportunities", {
  "filter": {
    "accountName": accountName
  }
});
return opportunities;

The root cause of the issue is that the prompt template is not correctly configured to retrieve data from the data graph. The field mapping is not set up correctly, which is preventing the prompt template from returning any data.

Resolving the Issue

To resolve the issue, we need to check the field mapping in the prompt template and ensure that it is correctly set up to retrieve data from the data graph. We also need to verify that the data graph is correctly configured and that the required data is available.

Heads up: Make sure to check the data graph and prompt template configurations carefully to ensure that they are set up correctly.

Checklist for Creating an Employee Agent

  • Create a data graph with the relevant Salesforce object as the root
  • Set up a prompt template with field mapping to retrieve the required data
  • Verify that the data graph and prompt template configurations are correct
  • Test the employee agent to ensure it is working as expected
  • Integrate the employee agent with Slack

What is the purpose of the data graph in Agentforce?

The data graph is used to retrieve data from Salesforce and make it available to the employee agent.

How do I set up field mapping in the prompt template?

Field mapping is set up by mapping the fields in the prompt template to the fields in the data graph.

What are some common issues that can occur when creating an employee agent?

Common issues include incorrect data graph configuration, incorrect prompt template configuration, and insufficient permissions.

How do I integrate the employee agent with Slack?

The employee agent can be integrated with Slack using the Agentforce Slack integration.

Genetrix Technology · Salesforce Marketing Cloud Partner

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.

Get in Touch with Genetrix →

Blogs for the

Business-Savvy!​

Let’s Connect

A 30 min no cost strategy session
with cloud support expert

Let’s Connect

A 30 min no cost strategy session
with cloud support expert