Salesforce | Yext Hitchhikers Platform

Use the Salesforce source to pull Salesforce objects into Yext Content.

Operations

This source uses Salesforce APIs to handle two operations:

  1. Fetch Objects
  2. Fetch Cases and Chatter Comments

Fetch Objects

Fetch data for any Salesforce object type.

Source Inputs

Authentication: Link your Salesforce account which has access to the desired objects. See the Authentication section for more details on linking your account.

Instance URL: Specify the full Salesforce instance URL, e.g., https://company.my.salesforce.com

Object: Specify the object type in Salesforce for which you want to fetch data. See the reference materials for standard Salesforce objects for more information.

Data Fetches

See Salesforce documentation for more details about the Salesforce Rest API and SOQL queries .

In order to get all object data, our system will make the following request:

[instance_url]/services/data/v53.0/query?q=SELECT FIELDS(ALL) FROM [object] order by id LIMIT 200

Due to limitations of the Salesforce API, our system paginates through responses using complex logic that does not follow a standard pagination method.

All available fields will be pulled in for the object.

Fetch Cases and Chatter Comments

Fetch all Cases and associated Chatter (Feed) comments.

Source Inputs

Authentication: Link your Salesforce account which has access to the desired objects. See the Authentication section for more details on linking your account.

Instance URL: Specify the full Salesforce instance URL, e.g., https://company.my.salesforce.com

Data Fetches

See Salesforce documentation for more details about the Salesforce Rest API and SOQL queries .

In order to get all case data as well as associated feed items and email messages for each case, our system will make the following requests:

  1. Fetch all Case objects: [instance_url]/services/data/v53.0/query?q=SELECT FIELDS(ALL) FROM Case ORDER BY id LIMIT 200
  2. For each case, fetch the associated FeedItems: [instance_url]/services/data/v53.0/query?q=Select Id, (Select Body, CreatedById, InsertedById, InsertedBy.Name, + CreatedDate, Id, IsDeleted, LastModifiedDate, LinkUrl, Title, Type + FROM Case.Feeds WHERE Type != 'EmailMessageEvent' Limit 20) FROM Case WHERE Id in ([case])
  3. For each case, fetch the associated EmailMessages: [instance_url]/services/data/v53.0/query?q=Select Id, (SELECT CreatedById, CreatedBy.Name, CreatedDate, FromAddress, + FromName, HasAttachment, HTMLBody, Id, Subject,TextBody, ToAddress + FROM Case.EmailMessages Limit 20) FROM Case WHERE Id in ([case])

Note that only the 20 most recent FeedItems and EmailMessages for a given Case are fetched.

The system will then return a single record for each case, with the associated feed items and email messages for each case appended to the response.

Due to limitations of the Salesforce API, our system paginates through responses using complex logic that does not follow a standard pagination method.

Authentication

Select the Salesforce account to fetch your data from. This account must exist in Yext as a linked account under the Salesforce Built-in Provider.

You can add a linked account directly from the Connector Settings page (in the dropdown to select a linked account), or from Content > Configuration > Linked Accounts > Salesforce Page in your account.

When you click Add Linked Account, you’ll see the following scopes to add:

  • api (required)

    • Allows access to the current logged-in user’s account using APIs, such as REST API and Bulk API 2.0. This scope also includes chatter_api, which allows access to connect REST API resources
  • full

    • Allows access to all data accessible by the logged-in user, and encompasses all other scopes.
  • refresh_token

    • Allows a refresh token to be returned when the requesting client is eligible to receive one. With a refresh token, the app can interact with the user’s data while the user is offline.

Click Link and continue through the Salesforce OAuth flow. Once the authentication setup is complete, you’ll need to provide a specific name and ID for your linked account. You may want to use the email address you linked as the Name, and the email address preceded by salesforce. for the Linked Account ID. For example, you might name your linked account radler@gmail.com, with an ID of salesforce.radler@gmail.com.