Skip to content
IT Canvass
Integrations · Lesson

Salesforce integration

Quick answer

A real-time ServiceNow ↔ Salesforce integration so support agents see live account context and cases/accounts stay in sync. This uses the Salesforce spoke (outbound) plus a Platform Event/webhook (inbound).

Key takeaways

  • Prerequisites
  • Step 1, Create a Salesforce Connected App
  • Step 2, Connection & Credential alias
  • Step 3, Field mapping
  • Step 4, Outbound: create/update in Salesforce

A real-time ServiceNow ↔ Salesforce integration so support agents see live account context and cases/accounts stay in sync. This uses the Salesforce spoke (outbound) plus a Platform Event/webhook (inbound).

Prerequisites

  • ServiceNow: admin, IntegrationHub, and the Salesforce spoke from the Store.
  • Salesforce: a System Administrator and API access enabled on the profile.
  • A Salesforce Connected App for OAuth 2.0.

Step 1, Create a Salesforce Connected App

  • In Salesforce Setup → App Manager → New Connected App, enable OAuth Settings.
  • Set the callback URL to your instance (https://<instance>.service-now.com/oauth_redirect.do) and scopes api, refresh_token.
  • Record the Consumer Key and Consumer Secret.

Step 2, Connection & Credential alias

  • Install the Salesforce spoke.
  • Create an OAuth 2.0 entity (Authorization Code or JWT bearer for server-to-server) with the consumer key/secret and Salesforce token URL.
  • Attach it to the spoke's Connection & Credential alias; use the Salesforce instance URL as the base.

Step 3, Field mapping

Salesforce Account       ServiceNow (core_company / account)
Name                 ->  name
AccountNumber        ->  u_sfdc_account_number
Industry             ->  u_industry
Id                   ->  u_sfdc_id  (store for correlation)

Step 4, Outbound: create/update in Salesforce

  • Build a flow triggered on a ServiceNow CSM case create/update.
  • Use Salesforce → Create/Update Record with a SOQL upsert keyed on u_sfdc_id to avoid duplicates.

Step 5, Real-time inbound from Salesforce

  • Preferred: create a Platform Event or Change Data Capture in Salesforce and subscribe with the spoke's streaming action.
  • Simpler: an Apex trigger + Outbound Message/Named Credential that POSTs to a ServiceNow Scripted REST API on Account change.
// SOQL used by the spoke to pull an account
SELECT Id, Name, AccountNumber, Industry
FROM Account WHERE Id = :sfdcId

Step 6, Test & promote

  • Update an account in Salesforce and confirm the ServiceNow company record updates in near real time.
  • Create a case in ServiceNow and confirm it appears/links in Salesforce.
  • Bundle in an update set and promote.

Troubleshooting

  • INVALID_SESSION_ID: refresh token expired, re-authorise the OAuth entity.
  • Duplicates: your upsert external-id field isn't set, confirm u_sfdc_id mapping.
  • API limits: batch high-volume syncs and respect Salesforce API call limits.
Use Change Data Capture over polling for true real-time inbound, it pushes changes instead of you querying on a schedule.

Want to learn this properly?

Our live, instructor-led ServiceNow Training covers this hands-on, with real projects and a certification path.

Check your understanding

  1. What does Salesforce usually own in this pairing?

    • A. Customer / account data
    • B. The CMDB
    • C. ACLs
    Show answer

    A. Customer / account data

    Salesforce is the CRM system of record.

  2. Which auth do these APIs typically use?

    • A. OAuth
    • B. No auth
    • C. Basic only
    Show answer

    A. OAuth

    OAuth is standard for Salesforce APIs.

Frequently asked questions

What is involved in setting up - Salesforce integration?

In Salesforce Setup → App Manager → New Connected App, enable OAuth Settings. Set the callback URL to your instance (https://<instance>.service-now.com/oauth_redirect.do) and scopes api, refresh_token. Record the Consumer Key and Consumer Secret.

What else is worth knowing about - Salesforce integration?

ServiceNow: admin, IntegrationHub, and the Salesforce spoke from the Store. Salesforce: a System Administrator and API access enabled on the profile. A Salesforce Connected App for OAuth 2.0.
CallWhatsAppEnquire