Home › Contact Center / Omnichannel › Using OData Queries in Omnichannel Configuration to Surface Data
Contact Center / Omnichannel · May 6, 2021

Using OData Queries in Omnichannel Configuration to Surface Data

In this post, we will look at how to use OData queries in Omnichannel to surface data to an agent. Let’s look at some scenarios.

First, in a previous post we looked at how to pass parameters from a pre-conversation survey to the Omnichannel agent’s desktop. We prompted the user to enter their case number and favorite color:

The user then enters these answers into their chat:

And we can access these answers through the custom {Color} context variable and the out of the box automation dictionary parameter keys such as {caseId} and {caseTitle}.

We can then construct OData queries in the format:

{$Odata.<entityName>.<entityAttributeName>.<?options>}

For example:

{$odata.incident.title.?$filter=incidentid eq ‘{caseId}’&$select=title}

This uses the {caseId} context variable and selects the title from the incident (which ends up actually being the same as the {caseTitle} context variable:

So if we have an application tab that does a Search, if we want to default the search text like below:

When the chat comes into Omnichannel, we see the case number is used to display the case information as out of the box functionality:

And we can see the tabs opened, with the Search 1 tab is displaying the title based on the OData query:

Let’s say we want to look up the description of the case from the description field below:

We can change the OData to pull the description field:

{$odata.incident.description.?$filter=incidentid eq ‘{caseId}’&$select=description}

The call then displays the description like below:

You can read more about the useful automation dictionary and data parameter key features on the Microsoft documentation website here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.