{"id":148,"date":"2021-01-12T15:47:44","date_gmt":"2021-01-12T15:47:44","guid":{"rendered":"http:\/\/167.71.55.215\/?page_id=148"},"modified":"2023-02-03T08:39:25","modified_gmt":"2023-02-03T08:39:25","slug":"word","status":"publish","type":"page","link":"https:\/\/info.documotor.com\/?page_id=148","title":{"rendered":"Word"},"content":{"rendered":"\n<p>This section explains the configuration of Documotor in Word, describing how to bind transformed data to your Microsoft Word document.<\/p>\n\n\n\n<p>In order to define what data goes where in the document, we utilize Word&#8217;s native functionality, <a href=\"https:\/\/support.microsoft.com\/en-us\/office\/about-content-controls-283b1e29-0b77-4781-b236-2d02c1cce1c2\">Content Controls<\/a>. <\/p>\n\n\n\n<p>The types of bindings described in this section are usually placed in the tag of a rich text content control. <\/p>\n\n\n\n<p>The placement of the content control in the document defines where the data is inserted, and the keys and values in the tag defines what data is inserted at that specific location.<\/p>\n\n\n\n<p>The content control binding will consist of two values &#8211; <code>BindingType<\/code> and <code>BindingKey<\/code>. The articles in this section explains the various <code>BindingTypes<\/code>, and thus describes how to bind data to <em>fields<\/em>, <em>images<\/em>, <em>tables<\/em>, <em>showing\/hiding <\/em>sections of the document and more. <\/p>\n\n\n\n<p>Read below for information on the <code>BindingKey<\/code> property of the binding.<\/p>\n\n\n\n<h2>Binding keys<\/h2>\n\n\n\n<p>Bindings are resolved from the binding scope based on the path defined. Initially the scope of the document is the whole dataset.<\/p>\n\n\n\n<p>For example, a document created with the following dataset:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n   \"title\": \"Product Quote\",\n   \"contact\": {\n     \"name\": \"John Doe\"\n   },\n   \"products\": [\n     {\n       \"name\": \"Grey Tile\",\n       \"price\": \"40 $\"\n     },\n     {\n       \"name\": \"White Tile\",\n       \"price\": \"39 $\"\n     }\n   ]\n }<\/code><\/pre>\n\n\n\n<p>Can have <a href=\"https:\/\/info.documotor.com\/?page_id=4229\">field bindings<\/a> made for:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">title -&gt; \"Product Quote\"\ncontact.name -&gt; \"John Doe\"\nproducts[0].name -&gt; \"Grey Tile\"\nproducts[0].price -&gt; \"40 $\"\nproducts[1].name -&gt; \"WhiteTile\"\nproducts[1].price -&gt; \"39 $\"<\/code><\/pre>\n\n\n\n<p>Some bindings instead evaluate the binding value to determine a true\/false value. Because any data can be evaluated we refer to these as a truthy or falsy. For a full list of falsies, see&nbsp;<a href=\"https:\/\/info.documotor.com\/?page_id=644\">Truthy values<\/a>. Anything that is not a falsy is truthy. An example is the <a href=\"https:\/\/info.documotor.com\/?page_id=144\">visibility binding<\/a> where the following bindings could be made:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">title -&gt; true\ncontact.name -&gt; true\nproducts -&gt; true\nservices -&gt; false\nproducts[0].name -&gt; true\nproducts[0].qty -&gt; false<\/code><\/pre>\n\n\n\n<p>Paths are relative to the current scope. The scope starts at the root of the data and can change in case of some nested bindings, for example a field binding inside a table binding. If a binding doesn\u2019t mention change of scope, it means the scope is unchanged even in case of nested bindings. For example if there is a field inside a visibility, then the field will have the same scope as the visibility.<\/p>\n\n\n\n<p>A path can consist of a property name or\/and index as shown in the example above. Besides this, the path can also be @. @ is the <a href=\"https:\/\/info.documotor.com\/?page_id=2896#section_0\">current scope<\/a> and is useful in cases where you have an array of values like the following example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n  \"products\": [ \"Grey Tile\", \"White Tile\"]\n}<\/code><\/pre>\n\n\n\n<p>If we then take the example of a field inside a table, the table would bind to&nbsp;<em>products<\/em>, while the field can then bind to @.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This section explains the configuration of Documotor in Word, describing how to bind transformed data to your Microsoft Word document. In order to define what data goes where in the document, we utilize Word&#8217;s native functionality, Content Controls. The types of bindings described in this section are usually placed in the tag of a rich [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":138,"menu_order":10,"comment_status":"closed","ping_status":"closed","template":"templates\/template-full-width.php","meta":[],"_links":{"self":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/148"}],"collection":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=148"}],"version-history":[{"count":36,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/148\/revisions"}],"predecessor-version":[{"id":4915,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/148\/revisions\/4915"}],"up":[{"embeddable":true,"href":"https:\/\/info.documotor.com\/index.php?rest_route=\/wp\/v2\/pages\/138"}],"wp:attachment":[{"href":"https:\/\/info.documotor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}