{"id":21866,"date":"2019-07-03T06:11:18","date_gmt":"2019-07-03T05:11:18","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-1\/?p=21866"},"modified":"2023-01-23T06:07:46","modified_gmt":"2023-01-23T06:07:46","slug":"using-bot-variables","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/bot-settings\/bot-management\/using-bot-variables\/","title":{"rendered":"Using Bot Variables"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p><strong>Bot variables<\/strong> help you capture values that are commonly used by different tasks, nodes, and other bot elements. You can configure a bot variable as a key-value pair once in the bot settings and substitute key with value at runtime during the conversation flow. By capturing frequently used values in a single place, bot variables provide the advantages of reusability and consistency. For example, let\u2019s say you are testing a flight booking bot using a staging endpoint. If you configure the endpoint as a variable, it helps you to call the API from several places quickly. When you want to change the staging endpoint to production while publishing the bot, it is easy. Similarly, variables can be used to externalize content for messages and prompts from the dialog flow definition. Kore.ai platform allows bot developers to define two types of variables &#8211; Environment and Content.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Environment_Variables\">Environment Variables<\/span><\/h3>\n<p>Environment Variables are global, reusable components which can be used in multiple places to define the bot configuration. Every Environment Variable is a key-value pair. The Variable Keys can be used at various places in the bot configuration. The platform will resolve\/replace the Variable Keys with Variables Values during the conversation. Some of the typical use cases where a developer can use environment variables are:<\/p>\n<ul>\n<li>To manage the bot across environments having different endpoint URLs. The bot can be exported and imported based on the environment, and the infrastructure team will need to modify only the variable configuration file.<\/li>\n<li>To manage <strong>Conditions<\/strong> in the <strong>Dialog Node<\/strong> Transitions. Only the left-hand side of the transition condition uses Environment Variables. The right-hand side of the transition conditions does not use Environment Variables <\/li>\n<li>To define and manage the bot response that is repeated within the bot configuration as variables.<\/li>\n<li>Authorization Token<\/li>\n<li>Channel-related tokens and URLs<\/li>\n<\/ul>\n<p>Post the release of v8.1 of the platform, for <span style=\"text-decoration: underline\">on-prem installations<\/span>, multiple value sets can be stored for these environment variables using Collections, <a href=\"\/docs\/bots\/bot-admin\/bots-management\/collections\/\" target=\"_blank\" rel=\"noopener noreferrer\">refer here for more<\/a>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Restricting_Sensitive_Data_with_Environment_Variables\">Restricting Sensitive Data with Environment Variables<\/span><\/h3>\n<p>During the virtual assistant definition, developers may create <b>environment variables<\/b> for sensitive data like credentials\/keys. These variables are useful for connecting to other systems using service nodes or as a part of authorization profiles. However, environment variables are visible to all the developers with shared access to the virtual assistant, especially when its definition is exported. <\/p>\n<p>The latest Kore.ai XO Platform release introduces the <b>Secure Variable<\/b> feature for environment variables, which encrypts the added variable when enabled. This makes only the encrypted variable value visible to others and not the original value. <\/p>\n<p><b>Important Considerations<\/b><\/p>\n<ul>\n<li>The <b>secure variable<\/b> is encrypted in the database and does not require any encryption key.<\/li>\n<li>The original value is used only internally for all service calls, language translation, etc. while executing the virtual assistant definition.<\/li>\n<li>During the export of a secure variable through <b>Bot<\/b> or <b>environment variables<\/b> import, it has an empty value, so the original value is not available in plain text.<\/li>\n<\/ul>\n<p><b>Leveraging Encrypted Environment Variable Values for Additional Modules<\/b><\/p>\n<p>You can use the encrypted environment variable values in the following modules in addition to the other supported modules:<\/p>\n<ul>\n<li><b>Channel Configuration<\/b>: While configuring channels under <b>Deploy<\/b> > <b>Channels<\/b>, you can use encrypted\/regular environment variable values for all the fields including access token, access key, app ID, URLs, etc.<\/li>\n<li><b>Languages<\/b>: Under <b>Build<\/b> > <b>Configurations<\/b> > <b>Languages<\/b> > <b>Translation Configurations<\/b>, while configuring the translation engine, you can use the regular\/encrypted environment variable value (type <code>{{env.environment variable name}}<\/code>) to set up the encrypted variable name as the access key as follows:<\/li>\n<ul>\n<li>The <b>Access Key<\/b> field for Google Translator or Microsoft Translator.<\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231103633\/ev-6.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231103633\/ev-6.png\" alt=\"\" width=\"600\" height=\"400\" class=\"alignnone size-full wp-image-50295\" \/><\/a><\/p>\n<li>The <b>Value<\/b> field in the <b>Configure Translation Engine<\/b> panel for Custom Translation Engine Configurations.<\/li>\n<\/ul>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231103801\/ev-7.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231103801\/ev-7.png\" alt=\"\" width=\"600\" height=\"400\" class=\"alignnone size-full wp-image-50298\" \/><\/a><\/p>\n<ul>\n<li><b>Authorization Profiles<\/b> \u2013 You can use encrypted\/regular environment variables on the following fields while defining a new authorization mechanism for all types of authorizations:<\/li>\n<ul>\n<li><b>Authorization Check URL<\/b>, <b>Field Key<\/b> for form field, and <b>Field Key<\/b> and <b>Field Value Authorization Fields<\/b> for Authorization Type <i>Basic Auth<\/i>. <a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/advanced-topics\/authorization\/setting-up-authorization-using-basic-auth\/\" rel=\"noopener noreferrer\" target=\"_blank\">Learn more<\/a>.<\/li>\n<li><b>Client Id<\/b>, <b>Client Secret Key<\/b>, and <b>Authorization URL<\/b> for Authorization Type <i>Oauth V2<\/i>. <a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/advanced-topics\/authorization\/setting-up-authorization-using-oauth-v2\/\" rel=\"noopener noreferrer\" target=\"_blank\">Learn more<\/a>.<\/li>\n<li><b>Client Id<\/b>, <b>Client Secret Key<\/b>, <b>Token Request URL<\/b>, <b>Scope<\/b>, and <b>Refresh Token URL<\/b>  for Authorization Type <i>Oauth V2 Client Credentials<\/i>. <\/li>\n<li><b>Consumer Key<\/b>, <b>Consumer Secret<\/b>, <b>Request Token Link<\/b>, <b>Access Token Link<\/b>, and  <b>User Authorization Link<\/b> for Authorization Type <i>Oauth V1<\/i>. <a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/advanced-topics\/authorization\/setting-up-authorization-using-oauth-v1\/\" rel=\"noopener noreferrer\" target=\"_blank\">Learn more<\/a>.<\/li>\n<li><b>Authorization Check URL<\/b> and <b>Field Key<\/b> (for Form Field) for Authorization Type <i>API Key<\/i>. <a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/advanced-topics\/authorization\/setting-up-authorization-using-an-api-key\/\" rel=\"noopener noreferrer\" target=\"_blank\">Learn more<\/a>.<\/li>\n<li><b>Field Key<\/b> for Form Field, <b>Token URL<\/b>, <b>Field Key<\/b>, and <b>Field Value<\/b> for Authorization Field, and <b>Refresh Token URL<\/b> for Authorization Type <i>Oauth V2 Password Grant Type<\/i>. <a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/advanced-topics\/authorization\/setting-up-authorization-using-oauth-v2-password-grant\/\" rel=\"noopener noreferrer\" target=\"_blank\">Learn more<\/a>.<\/li>\n<\/ul>\n<p>The availability of the environment variables has been extended to the <b>Field Key<\/b> and <b>Field Value<\/b> parameters.<br \/>\n<a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231103952\/ev-8.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231103952\/ev-8.png\" alt=\"\" width=\"500\" height=\"400\" class=\"alignnone size-full wp-image-50301\" \/><\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Content_Variables\">Content Variables<\/span><\/h3>\n<p>Bot building essentially requires extensive content management efforts. When it comes to multi-language bots, it also involves tedious coordination efforts between the developers and globally-distributed content authors or copyright team. Content variables enable you to overcome that by abstracting bot flow development efforts from authoring or editing the content. Using Content Variables, programmers can avoid hard-coding the bot content, such as prompts, messages, or any data presented to the user, into bot components, and instead point to specific variables in centrally managed Content Variables files for each bot language. You can export the language-specific content variable files to content editors, without exposing any bot configurations. The writers can author the content in the exported file, which you can import back into the bot.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Defining_Bot_Variables_and_Securing_Them\">Defining Bot Variables and Securing Them<\/span><\/h3>\n<p>Enabling the <b>secure variable<\/b> setting after defining an Environment (Bot) Variable, encrypts and securely stores credentials set as environment variables. To add a Bot variable, follow the steps below:<\/p>\n<ol>\n<li>Open the VA for which you want to add the variables.<\/li>\n<li>Navigate to <b>Build<\/b> > <b>Configurations<\/b> > <b>Environment Variables<\/b> on the left menu for Environment Variables or <b>Content Variables<\/b> to add Content Variables.<\/li>\n<li>In the <b>Add Variable<\/b> panel, provide the following details:<\/li>\n<\/ol>\n<ul>\n<li><b>Variable Name<\/b>: Enter the environment variable name. For example, user credentials.<\/li>\n<li><b>Value<\/b>: Enter the environment variable value that is encrypted.<\/li>\n<li><b>Notes (optional)<\/b>: Any tip\/note describing the environment variable.<\/li>\n<li><b>Group (optional)<\/b>: The name of the group to which the environment variable is mapped.<\/li>\n<li>Assign a <strong>Namespace<\/strong> if enabled (<a href=\"\/docs\/bots\/bot-settings\/bot-management\/managing-namespace\/\" target=\"_blank\" rel=\"noopener noreferrer\">refer here for more<\/a>).<\/li>\n<\/ul>\n<ol start=\"4\">\n<li>Enable the <b>secure variable<\/b> by switching to the <b>Enabled<\/b> state (<b>Disabled<\/b> is the default setting).<\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231095114\/ev-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231095114\/ev-1.png\" alt=\"\" width=\"500\" height=\"400\" class=\"alignnone size-full wp-image-50275\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231095114\/ev-1.png 506w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231095114\/ev-1-300x240.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<li>Click <strong>Save<\/strong>.<\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063843\/variables.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47085\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063843\/variables.png\" alt=\"\" width=\"600\" height=\"400\" \/><\/a><\/p>\n<li>The environment variable and its encrypted value appear in the list.<\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231095641\/ev-2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231095641\/ev-2.png\" alt=\"\" width=\"600\" height=\"400\" class=\"alignnone size-full wp-image-50278\" \/><\/a><\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Entering_Language-Specific_Values\">Entering Language-Specific Values<\/span><\/h3>\n<p>To add language-specific values for content variables, you first need to switch the bot language. You can switch the language by clicking the name of the currently-enabled language from the top-right corner of the bot\u2019s page and then selecting another language as follows:<br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063839\/switch-language.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47082\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063839\/switch-language-1024x487.png\" alt=\"\" width=\"640\" height=\"304\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063839\/switch-language-1024x487.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063839\/switch-language-300x143.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063839\/switch-language.png 1922w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a>\u00a0<\/p>\n<p>After switching the language, go to <strong>Build &gt; Configurations &gt; Content Variables <\/strong>page and click the <strong>edit <\/strong>icon next to the relevant variable. Replace the text in the <strong>Value <\/strong>field in the enabled language.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Using_Environment_Variables\">Using Environment Variables<\/span><\/h3>\n<p>You can invoke an environment variable in plain text mode (Standard editor) using the following syntax: <code>{{env.variableName}}<\/code> If you are using it in JavaScript mode, it is <em>env.variableName<\/em> Here\u2019s an example from a bot that uses two environment variables called <em>botType<\/em> and <em>parameters <\/em>to determine different bot environments such as development, testing, and production. The following script node in one of the bot\u2019s tasks captures the <em>base URL<\/em> of the bot, depending on the current bot environment.<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063846\/example-script.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47088\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063846\/example-script.png\" alt=\"\" width=\"536\" height=\"404\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063846\/example-script.png 536w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063846\/example-script-300x226.png 300w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/a><\/p>\n<p>The URL in the following service node changes based on the captured URL <a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063835\/service-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-47079\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063835\/service-1.png\" alt=\"\" width=\"816\" height=\"281\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063835\/service-1.png 816w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063835\/service-1-300x103.png 300w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Updating_the_Environment_Variable\">Updating the Environment Variable<\/span><\/h3>\n<p>For on-premise deployments, the user can update the encryption key\/secured variable value with a new one. To edit the value, follow these steps:<\/p>\n<ol>\n<li>Click the <b>Edit<\/b> icon of the secure variable listing.<\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231101526\/ev-3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231101526\/ev-3.png\" alt=\"\" width=\"500\" height=\"350\" class=\"alignnone size-full wp-image-50286\" \/><\/a><\/p>\n<li>In the <b>Edit Environment Variable<\/b> panel, click the <b>Edit<\/b> icon next to the <b>Value<\/b> textbox.<\/li>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231101654\/ev-4.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231101654\/ev-4.png\" alt=\"\" width=\"500\" height=\"450\" class=\"alignnone size-full wp-image-50289\" \/><\/a><\/p>\n<li>Enter the new variable value to be encrypted and click <b>Done<\/b>.<\/li>\n<li>Click <b>Save<\/b>.<\/li>\n<\/ol>\n<p>The new encrypted secure variable value is updated in the list as shown below:<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231101922\/ev-5.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221231101922\/ev-5.png\" alt=\"\" width=\"500\" height=\"350\" class=\"alignnone size-full wp-image-50292\" \/><\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Using_Content_Variables\">Using Content Variables<\/span><\/h3>\n<p>You can invoke a content variable in plain text mode (Standard editor) using the following syntax. <code>{{content.variableName}}<\/code> If you are using it in JavaScript mode, it is <em>content.variableName<\/em> Here\u2019s an entity node of a multi-language flight booking bot that captures the source airport of the users. It uses a content variable instead of a hard-coded user prompt. <br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063857\/node-example.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47097\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063857\/node-example.png\" alt=\"\" width=\"319\" height=\"201\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063857\/node-example.png 319w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063857\/node-example-300x189.png 300w\" sizes=\"auto, (max-width: 319px) 100vw, 319px\" \/><\/a><br \/>When the bot reaches this node as a part of the user interaction, the user prompt changes depending on the language of the interaction (provided you entered the respective variable values for all the enabled languages).<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Importing_and_Exporting\">Importing and Exporting<\/span><\/h3>\n<p>You can import and export bot variables between bots.<\/p>\n<ol>\n<li>On any of the Bot Variables page accessible from <strong>Build &gt; Configurations -&gt; (Environment\/Content) Variables<\/strong>,<\/li>\n<li>Click the <strong>ellipses next to Add Variables<\/strong><\/li>\n<li><em>To Import<\/em>: Select <strong>Import<\/strong> to import variables from a JSON or CSV file\n<ul>\n<li>Since the import will replace the existing variables, you are advised to take a backup of the same.<\/li>\n<li>After taking a Backup,\u00a0<strong>Proceed<\/strong> with the Import<\/li>\n<li>Select a JSON or CSV file to import (see below for the file format)<\/li>\n<\/ul>\n<\/li>\n<li><em>To Export<\/em>: From\u00a0<strong>Export<\/strong> select the preferred format for the export file:\n<ul>\n<li>Bot variables are exported in the form of a JSON, CSV file based upon your selection.<\/li>\n<li>This file includes both environment and content variables.<br \/><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063850\/import-export-1-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47091\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063850\/import-export-1-1-1024x456.png\" alt=\"\" width=\"640\" height=\"285\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063850\/import-export-1-1-1024x456.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063850\/import-export-1-1-300x134.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063850\/import-export-1-1.png 1922w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>The <strong>Bot Variable file<\/strong> contains the following information, the same needs to be present in your Import file. CSV files need a header row. You are advised to refer to the Export (or backup) file and use the same format for the Import file.<\/p>\n<ul>\n<li><strong>key<\/strong> (mandatory) &#8211; name of the variable<\/li>\n<li><strong>scope<\/strong>\u00a0 &#8211; the scope of the variable corresponds to the Setup Option at the time of variable declaration (if not provided will be set to prePopulated) and can be\n<ul>\n<li>prePopulated,<\/li>\n<li>askOnInstall, or<\/li>\n<li>hidden<\/li>\n<\/ul>\n<\/li>\n<li><strong>value<\/strong> &#8211; the value of the variables<\/li>\n<li><strong>variableType<\/strong> (if not set will default to env)-\n<ul>\n<li>env for Environment and<\/li>\n<li>locale for Content Variable<\/li>\n<\/ul>\n<\/li>\n<li><strong>audioTag\u00a0<\/strong>-for the player details in case IVR enabled<\/li>\n<li><strong>group<\/strong> &#8211; group name<\/li>\n<li><strong>hint\u00a0<\/strong>&#8211; description of the variable<\/li>\n<li style=\"font-weight: 400\"><strong>propagateVAlue <\/strong><span style=\"font-weight: 400\">&#8211; true or false<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>vNamespace <\/strong><span style=\"font-weight: 400\">&#8211; the namespace associated to the variable<\/span><\/li>\n<li style=\"font-weight: 400\"><strong>Language-specific variable<\/strong><\/li>\n<\/ul>\n<p><strong>Sample CSV file<\/strong>:<\/p>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063854\/importvariable_csv-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-47094\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063854\/importvariable_csv-1-1024x36.png\" alt=\"\" width=\"640\" height=\"23\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063854\/importvariable_csv-1-1024x36.png 1024w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063854\/importvariable_csv-1-300x10.png 300w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20221003063854\/importvariable_csv-1.png 1124w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><strong>Sample JSON file<\/strong>:<\/p>\n<pre>[\r\n  {\"key\":\"hosturl\",\r\n   \"value\":\"https:\/\/bots.kore.ai\",\r\n   \"hint\":\"This is the URL of environment which can be used across the endpoints configured in the bot\",\r\n   \"audioTag\":\"\",\r\n   \"variableType\":\"env\",\r\n   \"scope\":\"prePopulated\",\r\n   \"group\":\"URLS\"}\r\n]<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"Bot variables help you capture values that are commonly used by different tasks, nodes, and other bot elements. You can configure a bot variable as a key-value pair once in the bot settings and substitute key with value at runtime during the conversation flow. By capturing frequently used values in a single place, bot variables...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-21866","post","type-post","status-publish","format-standard","hentry","category-bot-management"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/21866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=21866"}],"version-history":[{"count":35,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/21866\/revisions"}],"predecessor-version":[{"id":61278,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/21866\/revisions\/61278"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=21866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=21866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=21866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}