web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Blogs / Everything D365 / Omnichannel for Customer Se...

Omnichannel for Customer Service : Custom Context Variables

TriciaSin Profile Picture TriciaSin 122 User Group Leader

When an agent accepts a chat in the Omnichannel experience for D365 Customer Service, context information is passed from the initiated chat to the agent’s desktop. This context information includes pre chat variables, bot variables – if the chat was escalated from a bot – as well as custom variables sent via custom code.

Context Variables can be used to route incoming chat messages , auto identify customers as well as provide information which the agent can use to their benefit ultimately reducing an agents average handling time and improving customer satisfaction.

In a previous blog, I shared how it is possible to create pre chat questions enabling agents to personalise the interaction they have with customers based on the information entered by the customer at the start of the chat. However, in some cases we may wish to provide information to an agent without the use of a pre chat questionnaire. For e.g. initiating a chat in an authenticated area of a portal or website without the need to re ask the customer for their name. Another example would be where there is a need to pass information from a website or portal to the agent.

To pass custom variables to the chat widget add the customProvider function to the page. The function can return string, integer or boolean variables as below and be displayed on the conversation form’s additional details tab if the isDisplayable parameter is true.

function contextProvider() {              
   return {
      'Name': {'value': 'Tricia Sinclair', 'isDisplayable': true},
      'Checkout_Value': {'value': 12.34, 'isDisplayable': true},
      'WebBasedError': {'value': true, 'isDisplayable': false}
   };
}

To pass the variables to the chat, the script below must be added before the chat is initiated.

Microsoft.Omnichannel.LiveChatWidget.SDK.setContextProvider(contextProvider);

In the video below, I show how this all comes together.


This was originally posted here.

Comments

*This post is locked for comments