Loading

Hide the Embedded Service Component Based on Service Agent Availability

Veröffentlichungsdatum: Apr 29, 2025
Beschreibung

In some scenarios, we require the Embedded Service component to show when the Salesforce service agent is online and hide when the agent is offline. But, Embedded Services are not designed to hide when there are no agents available.
 

Lösung

Currently, there is no API to check the Chat availability for a service agent and this limitation makes it difficult to hide the Embedded Chat component. Hiding the Embedded Chat component may be possible using JavaScript.

Chat implementation and Embedded Services differ in the way the service agent availability is captured, 

  • In Chat, you can wrap the online and offline buttons in a 'div' and pass the 'div Id' to the showWhenOnline method and display the div based on agent availability. 
  • For an Embedded Services implementation, there are no methods similar to Chat API to find the agent status. 

One possible approach could be to experiment to determine the Embedded Chat button action:

embedded_svc.settings.displayHelpButton = true; //Or false

Embedded Chat button is displayed when the value is true, and hidden when the value is false. As mentioned previously, there may be other custom solutions available via JavaScript.

To understand more on how to tweak the Chat box's appearance, please refer to the documentation for Customizable Parameters in the Embedded Chat code

Please note that these are some possible alternatives that need more review and coding to create a fully functional implementation. Please be aware that Salesforce Support will not be able to provide a working solution to these suggestions.

Nummer des Knowledge-Artikels

000383348

 
Laden
Salesforce Help | Article