{
    "componentChunkName": "component---src-templates-doc-page-js",
    "path": "/docs/en/analytics/custom_fields/",
    "result": {"data":{"site":{"siteMetadata":{"title":"Gatsby-doc-engine"}},"markdownRemark":{"id":"fd0d267f-d778-5d36-ad48-012728f4922e","excerpt":"Configurable fields in the exported data The export of custom fields from the  object is available in dialog analytics. The content of these fields is exported…","html":"<h1>Configurable fields in the exported data</h1>\n<hr>\n<p>The export of custom fields from the <code class=\"language-text\">$response</code> object is available in dialog analytics. The content of these fields is exported together with dialog logs.</p>\n<p class='warn'><a href=/1.10.3/docs/en/JS_API/variables/response  >More details about <code class=\"language-text\">$response</code></a></p>\n</br>\n<h4>Syntax</h4>\n<p>Specify an object for exporting in <code class=\"language-text\">$response</code>, for example in the following format:</p>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\">$response.&lt;object name to be displayed in the exported data> = $&lt;exported object></code></pre></div>\n<p>For example:</p>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\">$response.messageText = $parseTree.text;</code></pre></div>\n<p>Here <code class=\"language-text\">messageText</code> is the object name, <code class=\"language-text\">$parseTree.text</code> is the exported object.</p>\n</br>\n<h4>Export</h4>\n<p>Navigate to the <em>Analytics</em> project section. In the <em>Response Data Json Path</em> field specify the object name; for the above example this is <code class=\"language-text\">messageText</code>.</p>\n<p class='warn'>To add more data fields for exporting, click <em>add more</em> and specify the name of another object for exporting.</p>\n<p>To export logs, on the <em>Sessions</em> tab click <em>Dialogs log</em>.</p>\n</br>\n<h4>Use in a script</h4>\n<ul>\n<li>Exporting for telephony: here digits dialed by the client in the tone dialing mode are exported.</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">patterns:</span> \n\t$Digits = $regexp&lt;d+>\n\n<span class=\"token keyword\">theme:</span> /\n\n    <span class=\"token keyword\">state:</span> Main\n        <span class=\"token storageType\">q!:</span> * start\n        <span class=\"token variableParameter\">a:</span> Dial 4 digits in the tone dialing mode\n        <span class=\"token variableParameter\">script:</span>\n          $response.replies.push({\n            type: 'dtmf',\n            max: 4,\n            <span class=\"token variableParameter\">timeout:</span> 15000\n          });\n        \n        <span class=\"token keyword\">state:</span> Digits\n          <span class=\"token storageType\">q:</span> $Digits\n          <span class=\"token variableParameter\">a:</span> you dialed <span class=\"token constantCharacter\">{{$parseTree.text}}</span>! \n          <span class=\"token variableParameter\">a:</span> Thanks! Goodbye!\n          <span class=\"token variableParameter\">script:</span>\n            $response.replies.push({\n              type: 'hangup'\n            });\n            \n            $response.dtmf = $parseTree.text;\n        \n    <span class=\"token keyword\">state:</span> NoDigits\n      <span class=\"token storageType\">q!:</span> *\n      <span class=\"token storageType\">event:</span> noDtmfAnswerEvent\n      <span class=\"token variableParameter\">a:</span> You have not dialed a number!\n      <span class=\"token variableParameter\">go!:</span> /Main</code></pre></div>\n<ul>\n<li>Client data export: add postprocessing to the script and export the content of <code class=\"language-text\">$client</code> along with the dialog logs.</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"sc\"><pre class=\"language-sc\"><code class=\"language-sc\"><span class=\"token keyword\">init:</span> \n\tbind(\"postProcess\", function($context){\n\t\t $context.response.client = $context.client;\n});\n\n<span class=\"token keyword\">theme:</span> /\n\n    <span class=\"token keyword\">state:</span> Authorisation\n        <span class=\"token storageType\">q!:</span> * *start\n        <span class=\"token variableParameter\">script:</span>\n            $session = {};\n            $client = {};\n            $client.lastName = \"Bruce\";\n            $client.name = \"Wayne\";\n            $client.patronymic = \"Thomas\";\n        <span class=\"token variableParameter\">a:</span> Hello! Am I speaking to <span class=\"token constantCharacter\">{{$client.name}}</span> <span class=\"token constantCharacter\">{{$client.patronymic}}</span> <span class=\"token constantCharacter\">{{$client.lastName}}</span>?</code></pre></div>\n<p>Specify the fields to be exported:</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 979px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 49.16666666666667%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAABJ0AAASdAHeZh94AAABMUlEQVQoz5VSy07DMBD0/38OByQufABXvoADvZA2ievEz/VUs46LC+LASqM49uzs7NrGuQ2lFPgQMM8L1tXqOqakCDHCe48QAnLOSClhWVe4bWuc2MD93XuYfd/BKCKanHKGiECkKsqx3rYdMUblkkMTUuvBE9RatYCZl0UrE865RhTRL5GPZJ7RRT9rRb+hgjE2hyRyo2MkloPMNqdpwnQ+a2u14iGHweLmcpl1RqxqrVUn8kOUCfZ6BYvfHZLTIU2Uxszn6aRCVP+aJmxDUocO/NhnjM7uOGZr2AIdUpBurb0+zCgXXlZCj97eGH2vULBfBGNssbYhIRSBz6Lr+gdw1LjfMt9eLqVdyDCXPps6/P9CrchSkEuGdw6Gb4/K/Xn8BxSBAO/rB17fnpCeX3ADo7sRWaygkLcAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"fields to be exported\"\n        title=\"fields to be exported\"\n        src=\"/1.10.3/static/96b1aa8d3c3ddace41ac3f6baae5a4f8/adc48/Screenshot_1.png\"\n        srcset=\"/1.10.3/static/96b1aa8d3c3ddace41ac3f6baae5a4f8/e85cb/Screenshot_1.png 480w,\n/1.10.3/static/96b1aa8d3c3ddace41ac3f6baae5a4f8/d9199/Screenshot_1.png 960w,\n/1.10.3/static/96b1aa8d3c3ddace41ac3f6baae5a4f8/adc48/Screenshot_1.png 979w\"\n        sizes=\"(max-width: 979px) 100vw, 979px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>\n</br>\n<h4>View the configurable fields for the session</h4>\n<p>The <em>Dialogs</em> section for sessions displays custom fields specified in <em>Response Data Json Path</em>.</p>\n<p>Specify the custom fields > click <em>Apply</em>.</p>\n<p>In the <em>Sessions</em> table the values of the specified custom fields will be displayed along with the search results for each session.</p>\n<p><span\n      class=\"gatsby-resp-image-wrapper\"\n      style=\"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 1689px; \"\n    >\n      <span\n    class=\"gatsby-resp-image-background-image\"\n    style=\"padding-bottom: 41.875%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAICAYAAAD5nd/tAAAACXBIWXMAABJ0AAASdAHeZh94AAABH0lEQVQoz3WS3W6DMAyFef832s2eYJerpt102qAkqCklCYmTEDiTU6joqjn6ZMXExz+iakSHRkicWgEhJa7DAO8JxtjiGec9nLth7BongjYWQnaQsiueqermhI2fuilCy7IgTRPmeS7knEFEmHYxNi7EOXuNqjm12ODApe+RUipsyXPOsNbCOYec51KQj/e+5Ow1ngTPSiHEWB7fBBfENJUCbCy2dUgxPgv+DfAOecS95QVPRhPBKvUwbhmZF1k3Lb7rpsAdDlpDG3PHsNfrXRsYO+Kj/oQ4vKNt5WOHb2LA65fCy/GMQ6eRU4SnAGLCP1BAjAkhTWU9KQQclcbVESp16e+/R4gJjgJGTxidL/c9vEvuzq3f7ehKccau738BcHdjWBV0x0kAAAAASUVORK5CYII='); background-size: cover; display: block;\"\n  ></span>\n  <img\n        class=\"gatsby-resp-image-image\"\n        alt=\"fields in the dialogs section to be exported\"\n        title=\"fields in the dialogs section to be exported\"\n        src=\"/1.10.3/static/c16b7b9148b8b0d6eaf8ca9648d2e0d8/2f8cb/Screenshot_2.png\"\n        srcset=\"/1.10.3/static/c16b7b9148b8b0d6eaf8ca9648d2e0d8/e85cb/Screenshot_2.png 480w,\n/1.10.3/static/c16b7b9148b8b0d6eaf8ca9648d2e0d8/d9199/Screenshot_2.png 960w,\n/1.10.3/static/c16b7b9148b8b0d6eaf8ca9648d2e0d8/2f8cb/Screenshot_2.png 1689w\"\n        sizes=\"(max-width: 1689px) 100vw, 1689px\"\n        style=\"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;\"\n        loading=\"lazy\"\n        decoding=\"async\"\n      />\n    </span></p>\n<p>The field values are also displayed in the session data block, if you opened the session page from the search results in the <em>Dialogs</em> section where the custom fields have been specified in <em>Response Data Json Path</em>.</p>\n<p class='tip'>The custom field values that are current for the last phrase in the session are displayed.</p>","frontmatter":{"title":"","description":null},"headings":[{"value":"Configurable fields in the exported data"}]}},"pageContext":{"slug":"/docs/en/analytics/custom_fields/","previous":{"fields":{"slug":"/docs/en/account_management/plan/"},"frontmatter":{"title":"","description":null}},"next":{"fields":{"slug":"/docs/en/analytics/dialog_logs/"},"frontmatter":{"title":"","description":null}}}},
    "staticQueryHashes": ["1209419333"]}