{"id":121,"date":"2023-07-16T16:09:16","date_gmt":"2023-07-16T16:09:16","guid":{"rendered":"https:\/\/kb.ctse.nl\/?page_id=121"},"modified":"2025-03-24T11:31:08","modified_gmt":"2025-03-24T11:31:08","slug":"flow-wordtemplates","status":"publish","type":"page","link":"https:\/\/kb.ctse.nl\/?page_id=121","title":{"rendered":"Flow Template: Word placeholder values"},"content":{"rendered":"\n<p>In the PowerDoc Document Flow add a variable of type &#8220;object&#8221; and set as value as json object. The values can be hard coded or retrieved in one or more (Dataverse) actions before. The properties in the json object should have the same name as the <a href=\"https:\/\/kb.ctse.nl\/?page_id=106\" data-type=\"page\" data-id=\"106\">placeholders in the Word template<\/a>. See <a href=\"https:\/\/kb.ctse.nl\/?page_id=232\" data-type=\"page\" data-id=\"232\">tips &amp; trics<\/a> for usage value expressions. You can add properties in the json object which does not exists as placeholder in the Word template, these values will be ignored then.<\/p>\n\n\n\n<p>1. <strong>Plain Text<strong> Content Control<\/strong>:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"name\": \"Contoso\" }<\/code><\/pre>\n\n\n\n<p><strong>with stripping html code:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"html2text@personalnote2\": \"&lt;div&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;My personal note 2&lt;\/i&gt;&lt;\/b&gt;&lt;\/p&gt;&lt;\/div&gt;\" }<\/code><\/pre>\n\n\n\n<p>2. <strong>Rich Text Content Control:<\/strong><\/p>\n\n\n\n<p><strong>with custom styling:<\/strong><\/p>\n\n\n\n<p>{ <br>  &#8220;style@total&#8221;: { <br>    &#8220;value&#8221;: &#8220;\u20ac 1.120,00&#8221;, <br>    &#8220;p:style&#8221;: &#8220;My Custom Paragraph Style&#8221;<br>  } <br>}<br><br><strong>with custom styling (background color in a table cell):<\/strong><br><br>{ <br>  &#8220;style@total&#8221;: { <br>    &#8220;value&#8221;: &#8220;\u20ac 1.120,00&#8221;, <br>    &#8220;tc:bgcolor&#8221;: &#8220;rgb(221,221,221)&#8221; <br>  } <br>}<\/p>\n\n\n\n<p><strong>with html part:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"html@personalnote1\": \"&lt;div&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;My personal note 1&lt;\/i&gt;&lt;\/b&gt;&lt;\/p&gt;&lt;\/div&gt;\" }<\/code><\/pre>\n\n\n\n<p><strong>with full html part:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"xhtml@personalnote1\": \"&lt;html&gt;&lt;head&gt;&lt;style&gt;....&lt;\/style&gt;&lt;\/head&gt;&lt;body&gt;&lt;div&gt;&lt;p class=\"main\"&gt;My personal note 1&lt;\/p&gt;&lt;\/div&gt;&lt;\/body&gt;&lt;\/html&gt;\" }<\/code><\/pre>\n\n\n\n<p><strong>with docx:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"docx@conditions\": \"base64 string value of docx file...\" }<\/code><\/pre>\n\n\n\n<p><strong>with a pie chart:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"195\" height=\"99\" src=\"https:\/\/kb.ctse.nl\/wp-content\/uploads\/2025\/03\/image-1.png\" alt=\"\" class=\"wp-image-551\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{   \n  \"chart@pie1\": {\n      \"CategoryField\": \"product\",\n      \"ValueField\": \"revenue\",\n      \"Data\": &#91;\n        { \"product\": \"Laptop\", \"revenue\": 10000.00 },\n        { \"product\": \"Printer\", \"revenue\": 2400.00 }\n      ]\n  }\n}<\/code><\/pre>\n\n\n\n<p><strong>with a bar chart with multiple series:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"330\" height=\"109\" src=\"https:\/\/kb.ctse.nl\/wp-content\/uploads\/2025\/03\/image.png\" alt=\"\" class=\"wp-image-549\" srcset=\"https:\/\/kb.ctse.nl\/wp-content\/uploads\/2025\/03\/image.png 330w, https:\/\/kb.ctse.nl\/wp-content\/uploads\/2025\/03\/image-300x99.png 300w\" sizes=\"auto, (max-width: 330px) 100vw, 330px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>{   \n  \"chart@bar1\": {\n      \"SeriesField\": \"year\",\n      \"CategoryField\": \"product\",\n      \"ValueField\": \"revenue\",\n      \"Data\": &#91;\n\t{\n\t\t\"year\": 2020,\n\t\t\"product\": \"Laptops\",\n\t\t\"revenue\": 1000\n\t},\n\t{\n\t\t\"year\": 2020,\n\t\t\"product\": \"Printers\",\n\t\t\"revenue\": 1000\n\t},\n\t{\n\t\t\"year\": 2021,\n\t\t\"product\": \"Laptops\",\n\t\t\"revenue\": 1000\n\t},\n\t{\n\t\t\"year\": 2021,\n\t\t\"product\": \"Printers\",\n\t\t\"revenue\": 900\n\t}\n      ]\n  }\n}<\/code><\/pre>\n\n\n\n<p>3. <strong>Picture<strong> Content Control<\/strong>:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"logo\": { \"$content-type\": \"image\/png\", \"$content\": \"base64 string value...\" } }<\/code><\/pre>\n\n\n\n<p>or qr code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"qr@websiteurl\": \"https:\/\/www.contoso.com\" }<\/code><\/pre>\n\n\n\n<p>4. <strong>Date Content Control<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"quotedate\": \"2023-01-20T13:58:07Z\" }<\/code><\/pre>\n\n\n\n<p>5. <strong>Checkbox  Content Control<\/strong><\/p>\n\n\n\n<p>Note: only boolean values are allowed (true or false).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"included\": true }<\/code><\/pre>\n\n\n\n<p>6. <strong>Repeater<strong> Content Control<\/strong>:<\/strong><\/p>\n\n\n\n<p><strong>with multiple fields (for a table with multiple columns):<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \n  \"quotelines\": &#91;\n     { \"product\": \"Laptop\", \"price\": \"\u20ac 1000,00\", \"quantity\": \"10\" },\n     { \"product\": \"Printer\", \"price\": \"\u20ac 1200,00\", \"quantity\": \"2\" }\n  ]\n}<\/code><\/pre>\n\n\n\n<p><strong>with a simple list for a summary:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \n  \"productnames\": &#91;\n     \"Laptop\",\n     \"Printer\"\n  ]\n}<\/code><\/pre>\n\n\n\n<p>7. <strong>Full demo example:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{\n  \"name\": \"Contoso\",\n  \"logo\": { \"$content-type\": \"image\/png\", \"$content\": \"base64 string value...\" },\n  \"qr@websiteurl\": \"https:\/\/www.contoso.com\",\n  \"quotenumber\": \"123456\",\n  \"quotedate\": \"2023-01-20T13:58:07Z\",   \n  \"quotelines\": [\n     { \"product\": \"Laptop\", \"price\": \"\u20ac 1000,00\", \"quantity\": \"10\" },\n     { \"product\": \"Printer\", \"price\": \"\u20ac 1200,00\", \"quantity\": \"2\" }\n  ],\n  \"included\": true,\n  \"docx@conditions\": \"base64 string value of docx file...\",\n  \"html@personalnote1\": \"&lt;div&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;My personal note 1&lt;\/i&gt;&lt;\/b&gt;&lt;\/p&gt;&lt;\/div&gt;\",\n  \"html2text@personalnote2\": \"&lt;div&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;My personal note 2&lt;\/i&gt;&lt;\/b&gt;&lt;\/p&gt;&lt;\/div&gt;\",\n  \"chart@pie1\": {\n      \"CategoryField\": \"product\",\n      \"ValueField\": \"total\",\n      \"Data\": [\n        { \"product\": \"Laptop\", \"total\": 10000.00 },\n        { \"product\": \"Printer\", \"total\": 2400.00 }\n    ]\n  }\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In the PowerDoc Document Flow add a variable of type &#8220;object&#8221; and set as value as json object. The values can be hard coded or retrieved in one or more (Dataverse) actions before. The properties in the json object should have the same name as the placeholders in the Word template. See tips &amp; trics [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":274,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-121","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/kb.ctse.nl\/index.php?rest_route=\/wp\/v2\/pages\/121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.ctse.nl\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/kb.ctse.nl\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/kb.ctse.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.ctse.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=121"}],"version-history":[{"count":49,"href":"https:\/\/kb.ctse.nl\/index.php?rest_route=\/wp\/v2\/pages\/121\/revisions"}],"predecessor-version":[{"id":552,"href":"https:\/\/kb.ctse.nl\/index.php?rest_route=\/wp\/v2\/pages\/121\/revisions\/552"}],"up":[{"embeddable":true,"href":"https:\/\/kb.ctse.nl\/index.php?rest_route=\/wp\/v2\/pages\/274"}],"wp:attachment":[{"href":"https:\/\/kb.ctse.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}