How to Route Salesforce Chats via Skill selection from Pre-Chat?

How to Route Salesforce Chats via Skill selection from Pre-Chat?

1. Create a Picklist Field for Skill selection in the Case object/entity.

2. Create a Skill Picklist Field for Skill-Based Routing Rules in the Chat Transcript object/entity.

3. Create a Routing Configuration with “Use with Skills-Based Routing Rules” enabled.

4. Create a Queue and assign the Routing Configuration from Step 3.

5. Create Skills-Based Routing Rules for Chat Transcript Object. Do the Skill mapping here.

6. Create a file with .js as the extension. Use the following code in the file.

window._snapinsSnippetSettingsFile = ( function() {

    console.log( 
		"Static Resource file loaded" 
	);

    embedded_svc.snippetSettingsFile.extraPrechatFormDetails = [ {
        "label": "Skill",
        "transcriptFields":[ "Skill__c" ],
        "displayToAgent": true
    } ];
    
})();

This JavaScript code will store the Skill selected from the Pre-Chat on the Chat Transcript object/entity which in turn will be used in Skill-Based Routing Rules.

7. Upload the JavaScript file in Salesforce Static Resource. Please note the name of the Static Resource.

8. In you Experience Cloud Site Builder, set the “Snippet Settings File” to the Static Resource Name.

9. In the Embedded Service Deployment Chat Settings, add the Skill Picklist field created in Step 1 in the Pre-Chat Page.

10. Initiate the Chat from your Experience cloud site and test it.

Leave a Reply