Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
Copilot Studio bot is renamed as Copilot agent (agent or AI agent). Human agent is now renamed as customer service representative (service representative or representative). You might come across references to the old and new terms while we update the product UI, documentation, and training content.
Applies to: Dynamics 365 Contact Center—standalone and Dynamics 365 Customer Service only
This article lists the context variables for Azure and Copilot Studio agents, and how you can configure them in Omnichannel for Customer Service. To understand how to create context variables, see Manage context variables.
Context variables for Copilot Studio agents
The following table contains the list of context variables available in Omnichannel for Customer Service that you can use for configuring Copilot Studio agents.
Important
- Install the extension solutions to improve access to certain variables.
- Copilot Studio receives variables asynchronously during conversations, enabling AI agents to greet customers with low latency while using custom Contact Center data. When designing your agent, consider both data sources and retrieval times, as you might experience delays getting information from Dataverse environments. To manage late-arriving data, make sure you specify timeout settings in your variable definitions. Learn more in Set global variables from external sources.
Context variable type | Context variable name | Description | How to map in Copilot Studio |
---|---|---|---|
Pre-conversation survey | Use the pre-conversation survey question name that you create in Omnichannel for Customer Service. | The system stores responses from the pre-conversation survey as context variables. | Use the following information to map the question name in Omnichannel for Customer Service with the variable type in Copilot Studio:
|
Custom context for chat | Use the variable name that you create in Omnichannel for Customer Service or pass using the setContextProvider API. | The custom context variables that you create can be passed through the live chat SDK. | Use the following information to map the custom context variable in Omnichannel for Customer Service with the variable type in Copilot Studio:
|
Custom context for Direct Line | Use the variable name that you create in Omnichannel for Customer Service. | The custom context variables that you create can be passed through as key-value pairs in Activity.ChannelData.ConversationContext when your DirectLine client starts a conversation. | Use the following information to map the custom context variable in Omnichannel for Customer Service with the variable type in Copilot Studio:
|
Variables set by work classification rules | Use the variable name that you created in Contact Center Admin Center. | Custom variables generated as a part of work classification rules require extra processing time to generate the context. Set a timeout for the work classification context in your AI agent. Learn more in Set global variables from external sources. | Use the following information to map the custom context variable in Omnichannel for Customer Service with the variable type in Copilot Studio:
|
Conversation | msdyn_ConversationId | Use the context variable that contains the conversation ID for the ongoing conversation and can fetch and perform operations on the record in Microsoft Dataverse. | String: User's entire response. |
Messaging-only variables | msdyn_CustomerType 1 | Use this context variable that contains the customer type for the account or contact record linked to the conversation. | Select the Omnichannel for Customer Service extension solution variable. |
msdyn_CustomerName 1 | Use this context variable that contains the customer name for the account or contact record linked to the conversation. | Select the Omnichannel for Customer Service extension solution variable. | |
msdyn_CustomerId 1 | Use this context variable that contains the customer ID for the account or contact record linked to the conversation. | Select the Omnichannel for Customer Service extension solution variable. | |
msdyn_CaseId 1 | Use this context variable that contains the ID of the case record linked to the conversation. The data is retrieved from your Dataverse environment as a part of automatic customer identification. Hence, your AI agent may experience latency in receiving the data. | Select the Omnichannel for Customer Service extension solution variable. | |
msdyn_CaseTitle 1 | Use this context variable that contains the title of the case record linked to the conversation. | Select the Omnichannel for Customer Service extension solution variable. | |
msdyn_ChannelInstanceId | The Dataverse unique identifier of the Channel Instance record, for example, the unique identifier of the configured chat widget or Facebook page. | String: User's entire response. | |
msdyn_WorkstreamId | The Dataverse unique identifier of the Workstream associated with the channel instance. | String: User's entire response. | |
msdyn_Locale | The configured locale code on your channel instance, for example, your chat widget or Facebook page. This can be used for scenarios like multi-lingual Copilot Studio agents. | String: User's entire response. | |
msdyn_SocialProfileId | The Dataverse record unique identifier for the social profile associated with the conversation. | String: User's entire response. | |
msdyn_LineCustomerName | The customer name from the LINE API. | String: User's entire response. | |
msdyn_TeamsCustomerName | The customer name from Microsoft Teams. | String: User's entire response. | |
msdyn_TeamsCustomerEmail | The email address (UPN) from Microsoft Teams. | String: User's entire response. | |
msdyn_CapabilityList | Apple Messages for Businesses capability list values as a delimited string. | String: User's entire response. | |
msdyn_AppleMessagesForBusinessGroupId | Apple Messages for Businesses Group ID. | String: User's entire response. | |
msdyn_AppleMessagesForBusinessIntentId | Apple Messages for Businesses Intent ID. | String: User's entire response. | |
msdyn_AppleMessagesForBusinessLocale | Locale provided by the Apple Messages for Businesses API. | String: User's entire response. | |
msdyn_AppleBusinessId | The Business ID from your Apple Messages for Business account. | String: User's entire response. | |
msdyn_FacebookCustomerName | The customer name from Facebook. | String: User's entire response. | |
msdyn_FacebookLocale | The customer’s end user locale from Facebook. | String: User's entire response. | |
msdyn_FacebookTimezone | The customer timezone from Facebook. | String: User's entire response. | |
msdyn_FacebookUserPageScopedId | The customer’s page-specific user ID from Facebook. | String: User's entire response. | |
msdyn_FacebookPageId | The PageID from your Facebook page. | String: User's entire response. | |
msdyn_CustomerPhoneNumber | The phone number the customer is texting in from in WhatsApp and SMS channels. | String: User's entire response. | |
msdyn_OrganizationPhoneNumber | The phone number receiving messages from the customer (your organization’s number). Note this is not passed on WhatsApp via Azure Communication Services. | String: User's entire response. | |
msdyn_WhatsAppCustomerFirstMessage | If you are using a pre-filled message in your WhatsApp universal link, that information will be passed in this variable. | String: User's entire response. | |
Voice-only variables 2 | Activity.From.Name | Use this context variable for the customer's phone number in the Telephony activity. Assign this variable to a global variable in the Conversation Start topic. Learn more in Configure context variables for Copilot Studio agent. | Select the system variable from Microsoft Copilot Studio. |
Activity.Recipient.Name | Use this context variable for the organization's phone number in the Telephony activity. Assign this variable to a global variable in the Conversation Start topic. Learn more in Configure context variables for Copilot Studio agent. | Select the system variable from Microsoft Copilot Studio. | |
Extension method name | va_SurveyConsent | Use this dialog to determine if a customer has agreed to participate in surveys during the conversation. | Use this method to escalate conversation details to Omnichannel for Customer Service. |
va_CustomerLocale | Use this dialog to transfer the user currently talking to the agent to another agent that can speak in a different language. | Set the code by selecting the input variable and using the correct locale code. |
- 1 Data is retrieved from your Dataverse environment as a part of automatic customer identification. Your AI agent might experience latency when receiving this data.
- 2 To use other context variables for voice, you can obtain them from Copilot Studio. Learn more in Work with variables.
Configure context variables for Copilot Studio agent
To have your Copilot Studio agent read context variables from Omnichannel, do the following steps:
- On the Conversation Start topic, add a new node, and select Variable management > Set a variable value.
- In your new node, under Set variable select Create new.
- Select the new variable name. The Variable properties pane appears. In the pane, set the Variable name to match the Omnichannel context variable's name exactly (it's case sensitive).
- In the Reference section, select the ellipses (...) and select Get value from this node if empty. The Copilot Studio agent retrieves the variable value from this node at runtime.
- In the Usage section, select Global (any topic can access) and External sources can set values so that Copilot Studio agent accepts data from omnichannel and this variable can be used in any topic.
- If you are using data from your work classification rules in the variable, ensure you set a time-out length in the variable definition. Learn more in Set global variables from external sources.
- Close the Variable properties pane.
- In your node, enter a value in To value that matches the data type your agent expects. For example, if your agent should use the customer's phone number from omnichannel, set it to Activity.From.Name.
- Save and publish the changes.
During a conversation, the data from the Omnichannel context variable is set in the Copilot Studio variables and can be used in the agent's logic.
The agent can also set Omnichannel context variables during a conversation. To set an Omnichannel variable from your Copilot Studio logic, make sure that your agent is using the correct variable name and set the value in the "To value" property in your variable management node. Copilot Studio hands off the variable to Omnichannel during transfer to a customer service representative. This is often used to link the conversation to a case when the agent escalates the conversation to a service representative. More information on how to link records in Omnichannel from this data: Link customer and case to a conversation
The global variables that are created in Copilot Studio can be passed to Omnichannel for Customer Service when a conversation is escalated. For the complete list, see Contextual variables available upon hand off.
Parse JSON object to extract record ID
Make sure that you have the following details:
- The Omnichannel for Customer Service context variable, such as msdyn_contact_msdyn_ocliveworkitem_Customer.
- The schema details
A copy of the sample schema details is as follows:
Schema:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"RecordId": {
"type": "string"
},
"PrimaryDisplayValue": {
"type": "string"
}
},
"required": [
"RecordId",
"PrimaryDisplayValue"
]
}
}
PrimaryDisplayValue
contains the value from the attribute in the Dataverse entities. The mapping for the entity attributes is as follows:
- Cases: Case title
- Contacts: Full name
- Accounts: Name
Here's a sample context record.
{
"msdyn_contact_msdyn_ocliveworkitem_Customer": [
{
"RecordId": "<GUID>",
"PrimaryDisplayValue": "<FullName>"
}
],
"msdyn_liveworkitemid": "<GUID>"
}
Context variables for Azure agents
The following table contains the list of context variables in Omnichannel for Customer Service that you can use for configuring Azure agents.
Context variable type | Context variable name | Description | How to map in Azure |
---|---|---|---|
Pre-conversation survey | Use the pre-conversation survey question name that you create in Omnichannel for Customer Service. | The system stores responses from the pre-conversation survey as context variables. | Use the following information to map the question name in Omnichannel for Customer Service with the variable type in Azure:
|
Custom context | Use the variable name that you create in Omnichannel for Customer Service or pass using the setContextProvider API. | The custom context variables that you create can be passed through the live chat SDK. | Map the user's response as a JSON to use custom context variable in Omnichannel for Customer Service. |
Custom context for Direct Line | Use the variable name that you create in Omnichannel for Customer Service | The custom context variables that you create can be passed through as key-value pairs in Activity.ChannelData.ConversationContext when your DirectLine client starts a conversation. | Use the following information to map the custom context variable in Omnichannel for Customer Service with the variable type in Copilot Studio:
|
Conversation | msdyn_ConversationId | Use the context variable that contains the conversation ID for the ongoing conversation and can fetch and perform operations on the record in Microsoft Dataverse. | String: String |
Contact | msdyn_contact_msdyn_ocliveworkitem_Customer | Use this context variable that contains the record ID for the customer (contact) record that is linked to the conversation. | Parse JSON to extract record ID |
Account | msdyn_account_msdyn_ocliveworkitem_Customer | Use this context variable that contains the record ID for the account record linked to the conversation. | Parse JSON to extract record ID |
Case | msdyn_incident_msdyn_ocliveworkitem | Use this context variable that contains the record ID for the case record linked to the conversation. | Parse JSON to extract record ID |
Channel Instance | msdyn_ChannelInstanceId | The Dataverse unique identifier of the Channel Instance record – for example, the unique identifier of the configured chat widget or Facebook page | String: User's entire response. |
Workstream | msdyn_WorkstreamId | The Dataverse unique identifier of the Workstream associated with the channel instance. | String: User's entire response. |
Channel Locale | msdyn_Locale | The configured locale code on your channel instance. For example, your chat widget or Facebook page. This can be used for scenarios like multi-lingual Copilot Studio agents. | String: User's entire response. |
Social Profile | msdyn_SocialProfileId | The Dataverse record unique identifier for the social profile associated with the conversation. | String: User's entire response. |
Line Customer Name | msdyn_LineCustomerName | The customer name from the LINE API. | String: User's entire response. |
Teams Customer Name | msdyn_TeamsCustomerName | The customer name from Microsoft Teams. | String: User's entire response. |
Teams Customer Email | msdyn_TeamsCustomerEmail | The email address (UPN) from Microsoft Teams. | String: User's entire response. |
Apple Capabilities List | msdyn_CapabilityList | Apple Messages for Businesses capability list values as a delimited string. | String: User's entire response. |
Apple Group ID | msdyn_AppleMessagesForBusinessGroupId | Apple Messages for Businesses Group ID. | String: User's entire response. |
Apple Intent ID | msdyn_AppleMessagesForBusinessIntentId | Apple Messages for Businesses Intent ID. | String: User's entire response. |
Apple Locale | msdyn_AppleMessagesForBusinessLocale | Locale provided by the Apple Messages for Businesses API. | String: User's entire response. |
Apple Business ID | msdyn_AppleBusinessId | The Business ID from your Apple Messages for Business account. | String: User's entire response. |
Facebook Customer Name | msdyn_FacebookCustomerName | The customer name from Facebook. | String: User's entire response. |
Facebook Customer Locale | msdyn_FacebookLocale | The customer’s end user locale from Facebook. | String: User's entire response. |
Facebook Customer Timezone | msdyn_FacebookTimezone | The customer timezone from Facebook. | String: User's entire response. |
Facebook Customer Page Scoped ID | msdyn_FacebookUserPageScopedId | The customer’s page-specific user ID from Facebook. | String: User's entire response. |
Facebook Page ID | msdyn_FacebookPageId | The PageID from your Facebook page. | String: User's entire response. |
Customer Phone Number | msdyn_CustomerPhoneNumber | The phone number the customer is texting in from in WhatsApp and SMS channels. | String: User's entire response. |
Organization Phone Number | msdyn_OrganizationPhoneNumber | The phone number receiving messages from the customer (your organization’s number). Note this isn't passed on WhatsApp via Azure Communication Services | String: User's entire response. |
WhatsApp Universal link message | msdyn_WhatsAppCustomerFirstMessage | If you're using a pre-filled message in your WhatsApp universal link, that information is passed in this variable. | String: User's entire response. |
Note
Use the context variable names as defined and don't change them when you author flows in Azure or Copilot Studio agents. Also, be sure to use exact match to pass the value to the context variable because it's case-sensitive. If there's a mismatch, the record isn't automatically identified. More information: Identify records automatically
Related information
Integrate a Copilot Studio agent
Integrate an Azure agent
Configure agents to escalate and end conversations
Live chat SDK reference