Salesforce

Working with Salesforce Within Kognitos

This manual is divided into several sections, each focusing on a specific aspect of the Salesforce-Kognitos integration.

Introduction

The integration of Salesforce with Kognitos offers a powerful and intuitive way to interact with Salesforce data and functionalities. This integration enables users to perform a wide range of operations on Salesforce objects, including querying, creating, updating, and deleting records, managing files, and automating processes, all through the use of Kognitos’ natural language processing capabilities. This section provides an overview of the Salesforce-Kognitos integration and outlines the prerequisites for using Salesforce on Kognitos.

Prerequisites for Using KOG with Salesforce

Before you can start using KOG language to interact with Salesforce, there are several prerequisites that need to be met:

  1. Salesforce Account: You need to have an active Salesforce account. If you do not have one, you can sign up for a Salesforce trial account to get started.
  2. API Access: Ensure that your Salesforce account has API access enabled. API access is required for Kognitos to communicate with Salesforce.

Editions with API Access 
• Enterprise Edition
• Unlimited Edition
• Developer Edition
• Performance Edition

 
Editions without API Access 
• Group Edition
• Essentials Edition
• Professional Edition (can be purchased as an add-on)

  1. Security Token: Obtain your Salesforce security token, which is used in conjunction with your password to access Salesforce via the API securely. You can find this in your Salesforce settings under "My Personal Information" > "Reset My Security Token".
    You may need to contact your company’s IT support for the security tokens.
  2. Basic Understanding of Salesforce Objects: While Kognitos simplifies interactions, having a basic understanding of Salesforce objects (e.g., Account, Contact, Opportunity) and their relationships will help you automate more effectively with Kognitos.
  3. Familiarity with Kognitos Syntax: Familiarize yourself with the syntax and structure of KOG language to effectively communicate your commands and intentions.

Once these prerequisites are met, you are ready to start leveraging the power of KOG language to enhance your Salesforce experience, making it more accessible, efficient, and customizable.


Setting Up Salesforce Connection

Connecting to Salesforce

To interact with Salesforce using KOG language, establishing a secure connection to your Salesforce instance is the first critical step. This section outlines the credentials required for this connection and provides a detailed, step-by-step guide to connect successfully.

Required Credentials

To connect to Salesforce, you will need the following credentials:

  1. Salesforce Instance URL: The base URL of your Salesforce instance. This URL is unique to your organization and can be found in the address bar when you are logged into Salesforce. It typically follows the format https://<your_instance>.salesforce.com.
  2. Username: The email address or username associated with your Salesforce account.
  3. Password: The password for your Salesforce account.
  4. Security Token: A security token is an automatically generated key from Salesforce that adds an extra layer of security on top of your password. If you're accessing Salesforce from an untrusted network, you'll need this token. You can obtain your security token by navigating to your Salesforce settings and requesting a new token. Salesforce will email the token to the email address associated with your account.

Step-by-Step Connection Process

  1. Gather Credentials: Ensure you have all the required credentials: Salesforce instance URL, username, password, and security token.

  2. Connect Salesforce to Kognitos: Use the KOG language to initiate a connection to Salesforce. You will use a specific procedure designed for connecting to external services.

    connect to salesforce with
        the salesforce instance is "<Salesforce_Instance_URL>"
        the salesforce username is "<Your_Username>"
        the salesforce password is "<Your_Password>"
        the salesforce token is "<Your_Security_Token>"
    
    

    Replace <Salesforce_Instance_URL>, <Your_Username>, <Your_Password>, and <Your_Security_Token> with your actual Salesforce instance URL, username, password, and security token, respectively.

    connect to salesforce with
        the salesforce instance is "<https://login.salesforce.com>"
        the salesforce username is "[email protected]"
        the salesforce password is "password123"
        the salesforce token is "XYZ123456789"
    
    

Quick tip: If you don’t provide the last 4 lines, the system will prompt you to provide the required credentials. Just write connect to salesforce with and the follow along.

  1. Verify Connection: After executing the above command, Kognitos will attempt to establish a connection to Salesforce using the provided credentials. If the connection is successful, you can proceed with further operations like fetching, creating, or modifying Salesforce objects. If the connection fails, verify your credentials and ensure that your Salesforce instance URL, username, password, and security token are correct.

  2. Connection Established: Once the connection is successfully established, you are ready to perform various operations on Salesforce using KOG language. You can now fetch data, create new records, update existing ones, delete records, manage files, and more.


Working with Salesforce Objects

Interacting with Salesforce objects is a core functionality when integrating Salesforce with KOG language. This section covers how to fetch data, create and modify Salesforce objects, and delete them when necessary.

Fetching Data using custom SOQL queries

To fetch data from Salesforce using custom SQL queries, see the example below.

 fetch the records from salesforce where
      the query is "SELECT Id, Email FROM Contact"

Fetching Data using direct queries

To fetch data from Salesforce using custom SQL queries, see the example below.

get salesforce\'s leads whose annual revenue is less than 1000000000

Creating and Modifying Salesforce Objects

Adding New Records

To add a new record to Salesforce, you need to specify the type of object you're creating and provide the necessary field values.

Example:

the opportunity is
    the name is "New Deal"
    the close date is "2023-12-31"
    the stage is "Prospecting"
add the opportunity in salesforce

This command creates a new opportunity named "New Deal" with a close date and stage specified.

Updating Existing Records

To update an existing Salesforce object, you must identify the object by its ID and specify the fields you want to update.

Example:

the opportunity's ID is "006xx000001Sv6aAAC"
change the opportunity's stage to "Closed Won" in salesforce

This command updates the stage of the specified opportunity to "Closed Won".

Deleting Salesforce Objects

Single Deletion

To delete a specific Salesforce object, you need to specify the object and its ID.

Example:

the salesobject's ID is "006xx000001Sv6aAAC"
delete the salesobject

This command deletes the sales object with the specified ID.

By following these guidelines, you can effectively manage Salesforce objects using KOG language, from fetching and creating records to updating and deleting them as needed.


Managing Salesforce Reports

The ability to create, manage, and distribute Salesforce reports is crucial for analyzing business data and making informed decisions. Integrating Salesforce with Kognitos enhances the reporting process by simplifying the creation of reports, defining criteria, exporting reports, and even sending data directly from Salesforce via email. This section delves into how you can leverage KOG for managing Salesforce reports more efficiently.

Creating Salesforce Reports

Defining Report Criteria

Creating a report in Salesforce involves selecting the type of report, defining the criteria, and choosing the fields to display. With Kognitos, you can articulate these requirements in a more intuitive manner. For instance, you can specify the type of report you need, the records it should cover, and any specific conditions that must be met.

Example:

create a report in salesforce with
    the report name is "Quarterly Sales Summary"
    the report type is "Tabular"
    the fields are "Account Name", "Close Date", "Amount"
    the filter is "Close Date this quarter"

This command tells KOG to create a Salesforce report for opportunities from the last quarter, including specific fields. KOG translates this into the appropriate Salesforce report creation process, selecting the correct report type and applying the specified filters.

Exporting Reports to Different Formats

Once you have created a report in Salesforce, you might need to export it in various formats for analysis, presentation, or sharing purposes. KOG simplifies this process by allowing you to specify the desired export format directly in your command.

Exporting to CSV

export the report "Opportunities by Stage" from salesforce to CSV

This command instructs KOG to export the "Opportunities by Stage" report from Salesforce in CSV format. The CSV format is versatile and widely used for data manipulation and analysis in various software, including spreadsheet applications.

Exporting to PDF

export the report "Monthly Sales Performance" from salesforce to PDF

Exporting a report to PDF is particularly useful when you need a static snapshot of your data for sharing or presentation purposes. PDFs maintain formatting and are ideal for distributing reports that should not be altered, such as sales performance summaries or quarterly reviews.

Exporting to Excel

export the report "Lead Conversion Rates" from salesforce to Excel

Exporting reports to Excel allows for further data analysis and manipulation using Excel's robust set of features. Excel files can accommodate complex calculations, charts, and pivot tables, making them suitable for in-depth data analysis tasks.

Sending Data from Salesforce

Configuring Email Settings

Before you can send emails through Salesforce using Kognitos you need to ensure that your Salesforce email settings are correctly configured. Learn more here. This includes setting up email templates, defining sender profiles, and specifying email limits.


Approval Processes in Salesforce

Approval processes in Salesforce are automated sequences that an organization can use to approve records for database operations. These processes are crucial for maintaining data integrity and ensuring that changes or additions to records meet specific criteria set by the organization. The integration of KOG with Salesforce simplifies the interaction with these processes, making it easier for users to submit objects for approval and track their status.

Understanding Approval Processes

Approval processes in Salesforce are defined workflows that specify the steps required for a record to be approved. These processes can be applied to various Salesforce objects, such as Opportunities, Contacts, or custom objects, depending on the organization's needs. Approval processes typically involve one or more of the following components:

  • Criteria for entering the process: Defines what records are eligible for approval. For example, an opportunity might need to have a value greater than $10,000 to require approval.
  • Approval steps: The sequence of approval actions that need to be taken. This can involve multiple approvers at different stages.
  • Approval actions: Actions taken when a record is approved, rejected, or recalled, such as updating fields, sending email notifications, or executing custom logic.

Submitting Sales Objects for Approval

With Kognitos, users can submit Salesforce objects for approval using natural language commands. This simplifies the process, especially for users who may not be familiar with Salesforce's interface or approval process configurations.

Example:

submit the opportunity for approval with
    the opportunity's ID is "006xx000001Sv6aAAC"
    the comment is "Requesting approval for high-value opportunity"

In this example, an opportunity is submitted for approval by specifying its ID and providing a comment to give context to the approver. Kognitos translates this command into the appropriate Salesforce operation, automating the submission process.


File Management

Managing files within Salesforce objects is a common requirement for many business processes. Whether it's attaching contracts to accounts, downloading report attachments for analysis, or removing outdated files, efficient file management is crucial.

Attaching Files to Salesforce Objects

Attachment Process

Example: Attaching a PDF Contract to an Account

attach the file to the salesforce object with
    the file path is "/path/to/contract.pdf"
    the salesforce object's ID is "001xx000003DHP0AAO"
    the file type is "PDF"

This command specifies the file to attach (contract.pdf), identifies the Salesforce object by its ID, and indicates the file type. KOG handles the process of attaching the file to the specified Salesforce object.

Downloading Files from Salesforce Objects

Retrieving Attached Files

Example: Downloading a Contract Attached to an Account

download the file from the salesforce object with
    the salesforce object's ID is "001xx000003DHP0AAO"
    the file name is "contract.pdf"

This command retrieves an attached file (contract.pdf) from a specified Salesforce object. KOG facilitates the download process, making the file available for local use or review.

Detaching Files from Salesforce Objects

Removing Attachments

Example: Removing an Outdated Contract from an Account

detach the file from the salesforce object with
    the salesforce object's ID is "001xx000003DHP0AAO"
    the file name is "old_contract.pdf"

When a file, such as an outdated contract, needs to be removed from a Salesforce object, this command specifies the object and the file to be detached. KOG processes the request, removing the specified attachment from the Salesforce object.


Glossary of Terms

  • API (Application Programming Interface): A set of rules and protocols for building and interacting with software applications. Salesforce API allows external services like KOG to communicate with Salesforce to retrieve or modify data.
  • CRM (Customer Relationship Management): A technology for managing all your company's relationships and interactions with customers and potential customers. Salesforce is a leading CRM platform.
  • Salesforce Object: A database table in Salesforce. Common standard objects include Account, Contact, Lead, and Opportunity. Users can also create custom objects to store specific business data.
  • Salesforce Record: A single data entry within a Salesforce object. For example, a contact record in the Contact object.