Using OData Queries in Omnichannel Configuration to Surface Data

Leave a comment

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.

THANKS FOR READING. BEFORE YOU LEAVE, I NEED YOUR HELP.
 

I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.

IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.

THANK YOU, AND LET'S KEEP LEARNING TOGETHER.

CARL

https://www.youtube.com/carldesouza

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

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