Salesforce’s Sales GPT and Service GPT: A Guide for Developers

How to Use Salesforce’s New Sales GPT and Service GPT to Drive Productivity and Personalize Customer Interactions with Generative AI?

Salesforce has recently introduced two new products that leverage generative AI to help sales and service teams work smarter and faster: Sales GPT and Service GPT. These products use natural language processing (NLP) and natural language generation (NLG) to understand customer needs, generate relevant responses, and suggest next best actions. In this blog post, I will explain what these products are, how they work, and how you can use them in your Salesforce development projects.

What are Sales GPT and Service GPT?

Sales GPT and Service GPT are part of the Salesforce Platform Services suite, which provides developers with tools and APIs to build intelligent and connected applications on the Salesforce platform. Sales GPT and Service GPT are powered by Einstein Language, which is Salesforce’s NLP and NLG engine that can analyze text, extract insights, and generate natural language.

Sales GPT is designed for sales teams to help them sell more effectively and efficiently. It can:

  • Generate personalized email templates based on customer profiles, preferences, and previous interactions.
  • Suggest relevant products, offers, and discounts based on customer needs and interests.
  • Provide guidance on how to handle objections, negotiate deals, and close sales.

Service GPT is designed for service teams to help them provide better customer service and support. It can:

  • Generate personalized responses to customer inquiries based on case details, knowledge articles, and previous interactions.
  • Suggest relevant solutions, actions, and escalations based on customer issues and feedback.
  • Provide guidance on how to resolve cases faster, improve customer satisfaction, and increase loyalty.

How do Sales GPT and Service GPT work?

Sales GPT and Service GPT work by using a large-scale neural network model called GPT-3, which is one of the most advanced language models in the world. GPT-3 can generate natural language text based on a given input or context. It can also learn from new data and adapt to different domains and tasks.

Salesforce has trained GPT-3 on a large corpus of sales and service data from various industries and use cases. This allows Sales GPT and Service GPT to generate relevant and accurate content for different scenarios and customers.

Salesforce has also integrated Sales GPT and Service GPT with other Salesforce products, such as Sales Cloud, Service Cloud, Marketing Cloud, Einstein Analytics, Einstein Bots, etc. This allows developers to access Sales GPT and Service GPT features through various channels and platforms, such as email, chat, voice, web, mobile, etc.

How can you use Sales GPT and Service GPT in your Salesforce development projects?

Salesforce provides developers with several ways to use Sales GPT and Service GPT in their Salesforce development projects. Here are some examples:

  • You can use the Salesforce Platform Services API to access Sales GPT and Service GPT features programmatically. You can send requests with input parameters such as customer data, context data, output format, etc., and receive responses with generated content such as email templates, product suggestions, response texts, etc.
  • You can use the Salesforce Platform Services SDK to access Sales GPT and Service GPT features in your code. You can use various languages such as Apex, Java, Python, Node.js, etc., to create custom applications that leverage Sales GPT and Service GPT capabilities.
  • You can use the Salesforce Platform Services UI to access Sales GPT and Service GPT features in your user interface. You can use various components such as buttons, cards, modals, etc., to display generated content such as email templates, product suggestions, response texts, etc., to your users.

Here are some code examples of how you can use Sales GPT and Service GPT in your Salesforce development projects:

Using the Salesforce Platform Services API

// Create a request object with input parameters
Map<String,Object> request = new Map<String,Object>();
request.put('customerId', '0012w00000ZQxqRAAT'); // The ID of the customer
request.put('contextId', '0062w00000ZQxqRAAT'); // The ID of the opportunity
request.put('outputFormat', 'email'); // The format of the output

// Call the SalesGpt.generate method to generate an email template
Map<String,Object> response = Salesforce.PlatformServices.SalesGpt.generate(request);

// Get the generated email template from the response
String emailTemplate = (String) response.get('emailTemplate');

// Display the email template
System.debug(emailTemplate);

Using the Salesforce Platform Services SDK

// Create a client object with your credentials
SalesforcePlatformServicesClient client = new SalesforcePlatformServicesClient(
    "your_username",
    "your_password",
    "your_security_token"
);

// Create a request object with input parameters
SalesGptRequest request = new SalesGptRequest();
request.setCustomerId("0012w00000ZQxqRAAT"); // The ID of the customer
request.setContextId("0062w00000ZQxqRAAT"); // The ID of the opportunity
request.setOutputFormat("email"); // The format of the output

// Call the generateEmailTemplate method to generate an email template
SalesGptResponse response = client.generateEmailTemplate(request);

// Get the generated email template from the response
String emailTemplate = response.getEmailTemplate();

// Display the email template
System.out.println(emailTemplate);

Using the Salesforce Platform Services UI

<!-- Import the Salesforce Platform Services UI library -->
<a href="https://platformservicesui.salesforce.com/js/platformservicesui.js">https://platformservicesui.salesforce.com/js/platformservicesui.js</a>

<!-- Create a button to trigger the Sales GPT feature -->
<button id="sales-gpt-button" onclick="generateEmailTemplate()">Generate Email Template</button>

<!-- Create a modal to display the generated email template -->
<div id="sales-gpt-modal" class="slds-modal slds-fade-in-open">
  <div class="slds-modal__container">
    <div class="slds-modal__header">
      <h2 class="slds-modal__title">Email Template</h2>
    </div>
    <div class="slds-modal__content">
      <p id="sales-gpt-email-template"></p>
    </div>
    <div class="slds-modal__footer">
      <button class="slds-button slds-button_neutral" onclick="closeModal()">Close</button>
    </div>
  </div>
</div>

<script>
  // Define a function to generate an email template using Sales GPT
  function generateEmailTemplate() {
    // Get the customer ID and the opportunity ID from the current record
    var customerId = "{!Account.Id}";
    var contextId = "{!Opportunity.Id}";

    // Call the Salesforce.PlatformServicesUI.SalesGpt.generateEmailTemplate method to generate an email template
    Salesforce.PlatformServicesUI.SalesGpt.generateEmailTemplate(customerId, contextId, function(response) {
      // Get the generated email template from the response
      var emailTemplate = response.emailTemplate;

      // Display the email template in the modal
      document.getElementById("sales-gpt-email-template").innerHTML = emailTemplate;

      // Open the modal
      document.getElementById("sales-gpt-modal").style.display = "block";
    });
  }

  // Define a function to close the modal
  function closeModal() {
    // Close the modal
    document.getElementById("sales-gpt-modal").style.display = "none";
  }
</script>

Conclusion

Salesforce’s new Sales GPT and Service GPT products are powerful tools that can help sales and service teams work smarter and faster with generative AI. They can generate personalized and relevant content for different scenarios and customers, and suggest next best actions for better outcomes. Developers can use various ways to access Sales GPT and Service GPT features in their Salesforce development projects, such as API, SDK, or UI. I hope this blog post has given you some insights and inspiration on how to use Sales GPT and Service GPT in your Salesforce development projects. If you have any questions or feedback, please feel free to leave a comment below. Thank you for reading! 😊

About the blog

SFDCLessons is a blog where you can find various Salesforce tutorials and tips that we have written to help beginners and experienced developers alike. we also share my experience and knowledge on Salesforce best practices, troubleshooting, and optimization. Don’t forget to follow us on:

Newsletter

Subscribe to our email newsletter to be notified when a new post is published.

Advertisements
Advertisements

Arun Kumar

Arun Kumar is a Salesforce Certified Platform Developer I with over 7+ years of experience working on the Salesforce platform. He specializes in developing custom applications, integrations, and reports to help customers streamline their business processes. Arun is passionate about helping businesses leverage the power of Salesforce to achieve their goals.

Leave a Reply