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. 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

Once 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

Once 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.

Create an Account Mapping in CXone

Required permissions: Account Mapping Create

Before you can complete these steps, your CXone Account Representative needs to enable Salesforce Presence Sync for your tenantClosed High-level organizational grouping used to manage technical support, billing, and global settings for your CXone environment under Applications & FeaturesAdapters.

Once 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. When you do this, the Access Key ID is generated automatically.

  5. In the Salesforce Environment section, click ADD NEW.

  6. Fill out the fields in the Add New Environment form that appears.

  7. Click Map & Register.

  8. In the Salesforce Environment drop-down, select the Salesforce environment you just created.

  9. Click Save at the top.

Create a Presence Rule

Required permissions: Rules Create

Once 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.

    For example, If you select 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. Click Add Row to add more mappings.

  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.

    For example, if you select 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. Click Add Row to add more mappings.

  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.