Online Documents
English
English
  • First Launch Experience
  • Activate Software License
  • How to Train EMILY?
  • Simple Web Automation
  • Web Automation Tools
  • Web Automation Processor
  • User Fill
  • Workspace Script
  • File Exporter
  • File Enumerator
  • EXCEL Processor
  • EXCEL Analyzer
  • EXCEL Writer
  • EXCEL Filler
  • CSV Creator
  • PowerShell
  • PDF Analyzer
  • Mail Sender
  • Mail Reader
  • Exchange Mail Sender
  • Exchange Mail Reader
  • HTTP Analyzer
  • Command Line
  • DOCX Templater
  • SQL Executor
  • Desktop Automation (DA)
  • SFTP
  • JSON API Server
  • Chart
  • DOCX2HTML
  • Manage Folder
  • Google Drive
  • Google Sheets
  • Google OCR
  • Google NLU
  • Azure Form Recognizer
  • Anti-Captcha
  • ChatGPT
  • Gemini
  • Schedule Trigger
  • Mail Trigger
  • File Trigger
  • API Trigger
  • Protect Text
  • Flexibility & Security
  • Announcements
    • Version Release
    • Third Party Notice
Powered by GitBook
On this page
  • DOCX TEMPLATE
  • Input Object
  • output Object

DOCX Templater

Generate .docx/.pptx files with dynamic content using .docx/.pptx templates

PreviousCommand LineNextSQL Executor

Last updated 1 year ago

DOCX TEMPLATE

.docx/.pptx template used to generate files with dynamic content. Click on "PICK" to select the template file or use the %FILENAME% variable. Here's how to edit and compile a template file:

Text templates allow you to include variable names enclosed in percentage symbols, such as "%title%". These variables can be styled using text formatting in the template.

Array templates are defined using special delimiters, such as "%#arrayName%" to indicate the start of an array and "%/arrayName%" to indicate the end of the array. Within the array template, you can specify how each item in the array is formatted using text templates like "%keyName%" for each property of the array items. When inserting an array template into a document, rows, and sections will be automatically added based on the length of the array. If you want to introduce line breaks between items in the text, you can include line break syntax at the end of the array using the template tags.

Image templates are used to dynamically insert images into a document. To specify an image variable within a document template, you use the format "%img.variableName%" where "variableName" is the name of the image variable. The variable name should be preceded by "img". to indicate that it's an image variable. For example, %img.chart1%.

Input Object

Each key in the input object is the name of a .txt file in the working folder (excluding the file extension), and each value is the text content of the file.

// //Read the value of 'title.txt' and 'products.txt' in the workspace
let title = input['title']
console.log('title:', title)

let products = JSON.parse(input['products'])
console.log('products:', products)

output Object

Object to correspond to variables in a .docx or .pptx template file with the format "%key%". You must specify the value for the "key" variable within the output object as output['key']. If you are working with an array variable within a .docx template file with the format "%items%", you should make sure that output['items'] is an array containing the values you want to replace in the template.

// The .docx template file defines %title% and %#products% %name% %amount% %price% %/products%
output['title'] = title
output['products'] = products

// Insert the PNG file from the workspace
output['img.chart1'] = 'chart1.png'

--

We are dedicated to improving our content. Please let us know if you come across any errors, including spelling, grammar, or other mistakes, as your is valuable to us! 🤖️⚡️

feedback
template
output result