Enable Bi-Directional Presence Sync in Salesforce

You can enable bi-directional presence sync for CXone Agent Embedded for Salesforce and the Omni-Channel widget, which can include Agent for Service Cloud Voice. This ensures that when the agent's stateClosed The availability status of an agent changes in one of these apps, it changes in the other.

Complete each of these tasks in the order given.

Prerequisites

Create Presence Statuses in Salesforce

If you haven't already, create presence statuses in Salesforce. These are the statuses that appear in the Omni-Channel widget. Later on, you'll map them to the CXone agent states that appear in CXone Agent Embedded for Salesforce.

  1. Log in to Salesforce Lightning as an administrator.

  2. Click Setup Image of gear icon with lightning bolt inside. in the top right corner of the page and select Setup from the drop-down.

  3. Use the Quick Find box to search for Presence, then click Presence Statuses.

  4. Click New.

  5. Enter a Status Name. For example, Available for Chats. The Developer Name is generated automatically; it's the Status Name without spaces. For example, Available_for_Chats.

  6. Under Status Options, select one of these options:

    • Online: Make this an available status.

    • Busy: Make this an unavailable status.

  7. If you selected Online in the previous step, add channels to the status. Under Service Channels, select a channel in the list on the left, then click Add Image of right facing arrow. Repeat for each channel you want to add.

  8. Click Save. Repeat these steps for each presence status you want to create.

Add Presence Statuses to User Profiles

After you've created presence statuses, give Salesforce user profiles access to the statuses.

  1. In Salesforce, use the Quick Find box to search for Profiles, then click Profiles.

  2. Select the user profile you want to add presence statuses to.

  3. Scroll down to the Enabled Service Presence Status Access section. Click Edit.

  4. Select a status in the list on the left, then click Add Image of right facing arrow. Repeat for each status you want to add.

  5. Click Save. Repeat these steps for each user profile you want to add presence statuses to.

Create a Connected App

Create a connected app in Salesforce to connect Salesforce to CXone. You must configure OAuth 2.0 in this connected app so that data can be shared securely between Salesforce and CXone.

  1. In Salesforce, use the Quick Find box to search for App Manager, then click App Manager.

  2. Click New Connected App in the top right of the Lightning Experience App Manager.

  3. Enter a Connected App Name. For example, Salesforce Connector. The API Name is generated automatically; it's the Connected App Name without spaces. For example, Salesforce_Connector.

  4. In Contact Email, enter a valid email address.

  5. Under API (Enable OAuth Settings), select Enable OAuth Settings and configure the fields that appear.

    1. In Callback URL, enter the URL where you want the authorization code to be sent once the authentication is successful.

    2. In Selected OAuth Scopes, select the following scopes and click Add Image of right facing arrow:

      • Access Visualforce applications (visualforce)

      • Full access (full)

      • Manage user data via APIs (api)

      • Manage user data via Web browsers (web)

      • Perform requests at any time (refresh_token, offline_access)

  6. Make sure Require Secret for Web Server Flow and Require Secret for Refresh Token Flow are selected.

  7. Click Save.

Get Consumer Key and Consumer Secret

After you've created a connected app in Salesforce, find and save its Consumer Key and Consumer Secret.

  1. In Salesforce, use the Quick Find box to search for App Manager, then click App Manager.

  2. In the Lightning Experience App Manager, find the connected app you created. Click Actions Image of downward facing arrow. > View in the row for that connected app.

  3. Under API (Enable OAuth Settings), click Manage Consumer Details.

  4. If prompted, authenticate by entering the code sent to your email.

  5. Click Copy next to Consumer Key and Consumer Secret and store them in a secure location.

Configure Account Mapping

Before you create the account mapping, complete the following steps to avoid mapping errors within Salesforce.

  1. Log in to Salesforce and click the Settings icon.
  2. Use the Quick Find box to search for OAuth.
  3. From the Identity dropdown on the left menu, click OAuth and OpenID Connect Settings.
  4. On the OAuth and OpenID Connect Settings page, enable Allow OAuth Username-Password Flows.

From here, there are two options you can choose between to complete the configuration: adding an IP range or resetting the security token.

Only perform one of these options to prevent errors.

Option 1: Add IP Ranges to Agent Profiles

  1. In Salesforce, under Settings, use the Quick Find box to search for Profiles.

  2. Click the agent's profile and select Login IP Ranges from the top of the page.

  3. Enter the Start IP Address as 0.0.0.0 and the End IP Address as 255.255.255.255.

  4. Click Save.

Option 2: Reset Security Token

  1. In Salesforce, click your Admin profile > Settings > Reset Security Token to generate an security token. This will be sent to the email associated with this profile. Copy the token from the email.

  2. In CXone, click the app selector and select Adapters.
  3. Click Account Mapping in the left menu, then click the Salesforce tab.

  4. Scroll down to Salesforce Account Details.

  5. Go to the password field and append the security token onto the password associated with this profile. For example, if the password is xyz, and the security token is 123, you'll type xyz123 as the new password.

  6. Click Save.

Create an Account Mapping in CXone

Required permissions: Account Mapping Create

After you've created a connected app in Salesforce, create an account mapping in CXone to connect CXone to Salesforce.

  1. In CXone, click the app selector and select Adapters.

  2. Click Account Mapping in the left menu, then click the Salesforce tab.

  3. Click Map Accounts.

  4. In User for Access Key, select the user you want to generate an access key for. Click Next.

  5. In Salesforce Platform Version, choose whether your Salesforce environment is a Salesforce Production environment, a Salesforce Sandbox, or a Hyperforce environment.

  6. Create a Salesforce environment. Fill out the fields in the Salesforce section.

  7. Click Map & Register.

  8. In the Salesforce Environment drop-down, select the same Salesforce environment you entered in step 6.

  9. Click Save at the top.

Create a Presence Rule

Required permissions: Rules Create

After you've created an account mapping in Adapters, create a presence rule. This maps Salesforce statuses to CXone agent states, and CXone agent states to Salesforce statuses.

  1. In CXone, click the app selector and select Adapters.

  2. Click Presence Sync in the left menu, then click Get CXone Users. This refreshes the list of users.

  3. Click Create Rule.

  4. Give your presence rule a Name.

  5. In the Publisher States section, use the ACD State and Salesforce State drop-downs to map agent states. This tells Salesforce what status to display for a CXone agent state. Click Add Row to add more mappings.

    Elinor selects Open in ACD State and Available for Chats in Salesforce State. The Omni-Channel widget displays Available for Chats whenever CXone Agent Embedded displays Open.

  6. In the Subscriber States section, use the Salesforce State and ACD State drop-downs to map agent states. This tells CXone what agent state to display for a Salesforce status. Click Add Row to add more mappings.

    Elinor selects Available for Chats in Salesforce State and Open in ACD State. CXone Agent Embedded displays Open whenever the Omni-Channel widget displays Available for Chats.

    If you select Previous State in ACD State, the agent's CXone state returns to the previous state it was in. This may be useful to automatically return an agent's state back to what it was before handling an interaction.

  7. Click Create.

  8. To apply the presence rule to teams of users, click the Teams tab, then click Add Teams. Select the teams you want to add, then click Confirm.

  9. To apply the presence rule to individual users, click the Users tab, then click Add Users. Select the users you want to add, then click Confirm.

  10. Click Save.