![](https://www.infallibletechie.com/wp-content/uploads/2024/01/Display-Context-Variable-in-Salesforce-Einstein-BOT-1024x576.jpg)
{!$Context.VariableName} should be used to display Context Variable in Salesforce Einstein BOT.
1. Extract the BOT.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>WhatsApp_Bot</members>
<name>Bot</name>
</types>
<version>59.0</version>
</Package>
2. Add Context Variables to the BOT.
<contextVariables>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.ChannelType</fieldName>
<messageType>WhatsApp</messageType>
</contextVariableMappings>
<dataType>Text</dataType>
<developerName>ChannelType</developerName>
<label>Channel Type</label>
</contextVariables>
<contextVariables>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.ChannelName</fieldName>
<messageType>WhatsApp</messageType>
</contextVariableMappings>
<dataType>Text</dataType>
<developerName>ChannelName</developerName>
<label>Channel Name</label>
</contextVariables>
3. Deploy the changes to the org.
![](https://www.infallibletechie.com/wp-content/uploads/2024/01/Salesfore-Einstein-BOT-Metadata.png)
4. Make sure the Variables are created in the BOT.
![](https://www.infallibletechie.com/wp-content/uploads/2024/01/Messaging-Session-Einstein-BOT-Channel-Name-Context-Variable.png)
![](https://www.infallibletechie.com/wp-content/uploads/2024/01/Messaging-Session-Einstein-BOT-Channel-Type-Context-Variable.png)
5. Use the format {!$Context.VariableName} to display Context Variable in Salesforce Einstein BOT Builder or Dialog.
![](https://www.infallibletechie.com/wp-content/uploads/2024/01/Salesfore-Einstein-BOT-Context-Variable-Display.png)
Output:
![](https://www.infallibletechie.com/wp-content/uploads/2024/01/Display-Salesfore-Einstein-BOT-Context-Variable.jpg)