Skip to content
Back to Product

Umitake Document Generator for Kintone — User Manual

Table of Contents

  1. Overview
  2. Installation
  3. Plugin Configuration
  4. Preparing Templates
  5. Template Tag Reference
  6. Generating Documents
  7. Notes and Limitations
  8. Troubleshooting

Overview

The Document Generator Plugin automatically generates Word (DOCX), Excel (XLSX), and PDF documents from kintone record data.

Key features:

  • Insert field values into templates for document output
  • Loop expansion of subtable field rows
  • Loop expansion of related records fields (nested loops supported in DOCX and PDF)
  • Date, currency, and number formatting
  • Save generated files to an attachment field in the same app or another app
  • Generate documents via button click or status change trigger
  • Bulk output from the record list — process all records matching the current filter

Installation

  1. Open the kintone admin console (gear icon)
  2. Click Plugins
  3. Click Import Plugin
  4. Select and upload kintone-doc-generator.zip
  5. After uploading, open the settings for the target app
  6. From the Plugins tab, add "Document Generator"
  7. Click Settings to open the plugin configuration screen

Plugin Configuration

Click Settings for Document Generator in your app's plugin settings to open the configuration screen.

A settings size meter is shown at the top of the page. kintone plugin settings have a 256 KB limit. Be careful when using large HTML templates for PDF output.

Adding a Document Configuration

Click "+ Add Document Configuration" to add one output configuration. You can register multiple configurations per app (e.g., "Invoice", "Delivery Note", "Order Confirmation" in the same app).

Each configuration card has the following buttons in the header:

ButtonAction
Duplicate this configuration
↑ / ↓Reorder configurations
×Delete this configuration

Template Source

The template is specified differently depending on the output format.

DOCX / XLSX

Template files are stored as attachments in a separate kintone app (a template storage app).

Setting up the template storage app:

  1. Create a new kintone app (e.g., "Template Manager")
  2. Add an Attachment field (e.g., field code: template_file)
  3. Attach your template file (.docx or .xlsx) to a record and save
  4. Note the record number from the record URL

Plugin configuration example (invoice template):

FieldValue
App ID100 (the template storage app's ID)
Record ID1 (the record the template is attached to)
Field Codetemplate_file
File Nameinvoice_template.docx

PDF

PDF templates can be specified in three ways:

MethodDescription
From HTMLWrite HTML directly in the built-in HTML editor
From DOCXUse a DOCX template; converted to PDF by the backend service
From XLSXUse an XLSX template; converted to PDF by the backend service

From HTML:

Write your HTML in the editor on the settings screen. Use the "Full Screen Edit" button in the editor to expand to a full-screen modal. Use the field list button to insert field tags.

Page settings:

SettingOptions
Page sizeA4 / A3 / Letter
OrientationPortrait / Landscape

Note: PDF conversion from DOCX/XLSX requires a valid license and uses the backend conversion service.


Output Target

Specify where the generated file should be saved.

Same App (Attachment Field)

FieldDescription
Field CodeThe attachment field code to save the file to
Append ModeON: add to existing files / OFF: overwrite

Another App

FieldDescriptionExample
App IDTarget app ID
Attachment Field CodeAttachment field in the target app
Record Querykintone query to identify the target record (field tags supported)customer_code = "${CustomerCode}"
App ID Storage FieldField to store the source app ID on new record creation (optional)
Record ID Storage FieldField to store the source record ID on new record creation (optional)
Append ModeON: add to existing files / OFF: overwrite

Field tags (${fieldCode}) can be used in queries. If the query is empty or matches no records, a new record is created in the target app.


Filename Template

Specify the name of the generated file. Use field tags and system date tags for dynamic filenames.

Invoice_${CustomerName}_${InvoiceDate format="YYYYMMDD"}
Report_${@date format="YYYYMMDD"}

The file extension (.docx, .xlsx, .pdf) is added automatically — do not include it here.

Tip: OS-reserved characters (/, \, :, *, ?, ", <, >, |) in filenames are automatically replaced with underscores.


Output Trigger

Button

Displays a button on the record detail screen.

FieldDescription
Button LabelText displayed on the button (e.g., Create Invoice)
PositionHeader menu / Bottom of screen
Enable bulk output from listWhen ON, a bulk output button appears on the record list screen
Bulk output button labelLabel for the list-screen button (defaults to Button Label if empty)

Status Change

Runs when a process management status changes.

FieldDescription
Target StatusThe status name after the change (e.g., Approved)
Auto ExecuteON: run immediately without confirmation / OFF: show confirmation dialog

Preparing Templates

DOCX Template

Create a DOCX file in Word and write tags where you want field values inserted.

Key points:

  • Tags use the format ${fieldCode}
  • Enter tags as regular text, not Word "fields"
  • Font, size, color applied to the tag carry over to the output
  • Subtable loops are written in table rows

Example (invoice):

Invoice

Bill To: ${CustomerName}
Invoice Date: ${InvoiceDate format="MMMM D, YYYY"}
Due Date: ${DueDate format="MMMM D, YYYY"}

| Item | Qty | Unit Price | Amount |
|------|-----|-----------|--------|
| ${#LineItems} ${ItemName} | ${Qty} | ${UnitPrice currency="USD"} | ${Amount currency="USD"} ${/LineItems} |

Total: ${TotalAmount currency="USD"}

XLSX Template

Create an XLSX file in Excel and write one tag per cell.

Basic rules:

  • One tag per cell
  • Cell formatting (font, background, borders, number format) is preserved in output

Subtable loop (marker row method):

RowCol ACol BCol CCol D
10${#LineItems}
11${ItemName}${Qty}${UnitPrice currency="USD"}${Amount currency="USD"}
12${/LineItems}
  • Marker rows (${#~} / ${/~} only) are not included in output
  • Template rows are repeated once per subtable row
  • Multiple template rows expand to multiple output rows per subtable row

PDF Template

From HTML

Write HTML in the editor on the settings screen.

Subtable loop (using HTML comments):

<table>
  <tr>
    <th>Item</th>
    <th>Qty</th>
    <th>Unit Price</th>
  </tr>
  <!-- ${#LineItems} -->
  <tr>
    <td>${ItemName}</td>
    <td>${Qty}</td>
    <td>${UnitPrice currency="USD"}</td>
  </tr>
  <!-- ${/LineItems} -->
</table>

Tip: Complex CSS layouts (flexbox, grid) may not render correctly in PDF. Table-based layouts are recommended.

From DOCX / From XLSX

Create your template using the same DOCX or XLSX format described above. The generated file is converted to PDF by the backend service.


Template Tag Reference

Options Reference

Options are appended to tags in the format optionName="value". Flag options (image, qrcode, barcode, allOptions) are written without a value.

${fieldCode optionName="value" anotherOption="value"}
${fieldCode image}
${fieldCode allOptions checked="☑" unchecked="☐"}

Full options list:

OptionValueDefaultTarget FieldsDescription
formatDay.js format stringDate, datetime, @date, @datetimeOutput format for date/time values (e.g., "MMMM D, YYYY")
timezoneTimezone nameBrowser TZDate, datetime, @date, @datetimeOutput timezone (e.g., "America/New_York")
currencyCurrency codeNumberFormat with currency symbol and thousand separators (JPY, USD, EUR, GBP, etc.)
number"true" / decimal placesNumberFormat with thousand separators but no currency symbol ("2" = 2 decimal places, "true" = integer)
separatorAny string", "Checkbox, multi-select, user/org/group selectDelimiter for array fields ("\n" for newline)
prefixAny stringAll fieldsText prepended only when field has a value
suffixAny stringAll fieldsText appended only when field has a value
keyProperty namenameUser/org/group selectObject property to extract ("name", "code", etc.)
allOptions(flag)Checkbox, multi-selectOutput all options with checked/unchecked marks
checkedAny string"☑"With allOptionsMark for selected options
uncheckedAny string"☐"With allOptionsMark for unselected options
image(flag)AttachmentEmbed attached image in the document
indexInteger0Attachment (with image)Index of the file to use when multiple files are attached (0-based)
widthPixels200image, qrcode, barcodeImage width in pixels
heightPixels150image, barcodeImage height in pixels
qrcode(flag)Any fieldGenerate a QR code from the field value
barcode(flag)Any fieldGenerate a barcode from the field value
typeBarcode format"CODE128"With barcodeBarcode symbology

Basic Tags

${fieldCode}

Use the kintone field code exactly as shown in the form settings.

Supported field types:

Field TypeOutput
Text (single/multi-line)Entered text
NumberNumeric string
Date / Datetime / TimeISO format (e.g., 2024-01-15) — use format to reformat
LinkURL string
Radio / DropdownSelected value
Checkbox / Multi-selectComma-separated selected values
User / Org / Group selectComma-separated names
LookupReferenced value
CalculatedCalculated result
AttachmentUse image option to embed images
SubtableUse loop tags
Related recordsUse loop tags

Date Format

${fieldCode format="format-string"}
Format tokenMeaningExample
YYYY4-digit year2024
YY2-digit year24
MMMonth (2-digit)01
MMonth1
DDDay (2-digit)05
DDay5
HHHour (24h)14
mmMinute30
ssSecond00

Examples:

${InvoiceDate format="MMMM D, YYYY"}       → January 15, 2024
${InvoiceDate format="MM/DD/YYYY"}         → 01/15/2024
${UpdatedAt format="YYYY-MM-DD HH:mm"}    → 2024-01-15 14:30

Combine with timezone to output in a specific timezone:

${UpdatedAt format="YYYY-MM-DD HH:mm" timezone="America/New_York"}

Currency Format

${fieldCode currency="currencyCode"}
Currency CodeExample Output
JPY¥1,000
USD$1,000.00
EUR€1,000.00
GBP£1,000.00
${Amount currency="USD"}   → $1,234.56
${金額 currency="JPY"}     → ¥1,234,567

Number Format

${fieldCode number="option"}
Option valueExample outputDescription
"true" or "0"1,234,567Integer with thousand separators
"1"1,234.61 decimal place
"2"1,234,567.892 decimal places
${Quantity number="true"}   → 1,234
${UnitPrice number="2"}     → 1,234.00
${Rate number="1"}          → 98.5

System Date and Time Tags

Output the date or time when the document was generated. These are system tags, not kintone fields.

${@date}
${@datetime}
TagDefault outputDescription
${@date}2024-01-15Generation date
${@datetime}2024-01-15 09:30:00Generation date and time

Combine with format and timezone:

${@date format="MMMM D, YYYY"}                     → January 15, 2024
${@datetime format="MM/DD/YYYY HH:mm"}             → 01/15/2024 09:30
${@datetime format="HH:mm" timezone="Asia/Tokyo"}  → 18:30

Filename example:

Invoice_${CustomerName}_${@date format="YYYYMMDD"}

Conditional Prefix and Suffix

${fieldCode prefix="text"}
${fieldCode suffix="text"}

Prepends or appends text only when the field has a value. If the field is empty, the entire tag outputs nothing.

Example (address concatenation):

${City}${State prefix=", "}${Country prefix=", "}
CityStateCountryOutput
AustinTXUSAAustin, TX, USA
AustinUSAAustin, USA
AustinAustin
${Notes prefix="[" suffix="]"}

Wraps the notes field in brackets if it has a value; outputs nothing if empty.


Array Field Output

Checkbox, multi-select, and user-select fields output as arrays. Default delimiter is , .

separator — Custom delimiter

${Checkbox separator=" / "}       → Option A / Option B / Option C
${Assignees separator=" & "}      → Alice & Bob
${Tags separator="\n"}            → newline-separated

key — Property selection for user/org/group fields

Field typekey valueOutput
User selectname (default)Display name
User selectcodeLogin ID
Org selectname (default)Organization name
Org selectcodeOrganization code
${Assignees key="code" separator=","}   → user1,user2,user3

allOptions — Show all options with check marks

${CheckboxField allOptions}
→
☑ Option A
☐ Option B
☑ Option C
${CheckboxField allOptions checked="✅" unchecked="⬜" separator=", "}
→ ✅ Option A, ⬜ Option B, ✅ Option C

Image Insertion

Embed an attached image into the document.

${fieldCode image}
${fieldCode image index="1" width="300" height="200"}
OptionDefaultDescription
index0Index of the file when multiple files are attached (0-based)
width200Image width in pixels
height150Image height in pixels

Format-specific notes:

FormatNotes
PDF (HTML)Supported formats: JPEG, PNG, GIF, WebP
DOCXThe tag must be in a single text run. Do not apply formatting (bold, color, etc.) to image tags
XLSXOnly cells in inlineStr format (direct entry) are supported

QR Code and Barcode

Generate a QR code or barcode from a field value and insert it into the document.

QR Code

${fieldCode qrcode}
${URL qrcode width="200"}

Barcode

${ProductCode barcode}
${JANCode barcode type="EAN13" width="250"}

Supported barcode formats:

type valueFormatUse case
CODE128Code 128General purpose, alphanumeric (default)
EAN13EAN-13Retail product barcodes (13 digits)
EAN8EAN-8Compact retail barcodes (8 digits)
UPCUPC-ANorth American retail barcodes (12 digits)
CODE39Code 39Alphanumeric, medical/industrial use
ITF14ITF-14Logistics / shipping cartons

Conditional Blocks (IF/IFEXIST)

Show or hide parts of the document based on field values.

Syntax

${#if fieldCode}
content to show
${/if}

${#if fieldCode = "value"}...${/if}
${#if fieldCode != "value"}...${/if}
${#if fieldCode > 100}...${/if}

${#if Status = "Approved"}
This record is approved.
${#else}
Pending approval.
${/if}

${#ifexist fieldCode}
shown when field exists and is not empty
${/ifexist}

Condition behavior

SyntaxTrue when
${#if FIELD}Field value is non-empty and not "0"
${#ifexist FIELD}Field exists and is non-empty (also true when "0")
${#if FIELD = "value"}Exact string match
${#if FIELD > number}Numeric comparison

Format-specific syntax

DOCX: Write blocks at the paragraph level. Place ${#if ...} and ${/if} on separate paragraphs.

XLSX: Write blocks at the row level. Place ${#if ...} and ${/if} in separate rows.

PDF (HTML): Wrap blocks in HTML comments.

<!-- ${#if Status = "Approved"} -->
<p style="color:green">Approved</p>
<!-- ${#else} -->
<p style="color:gray">Pending</p>
<!-- ${/if} -->

<!-- ${#ifexist Notes} -->
<p><strong>Notes:</strong> ${Notes}</p>
<!-- ${/ifexist} -->

Note: Nested conditional blocks are not supported.


Subtable Loop Expansion

DOCX

Write the start tag, field tags, and end tag in a single table row.

| ${#LineItems} | ${ItemName} | ${Qty} | ${UnitPrice currency="USD"} | ${/LineItems} |

XLSX

Use marker rows (start/end) and template rows (data).

RowCol ACol BCol C
N${#LineItems}
N+1${ItemName}${Qty}${UnitPrice currency="USD"}
N+2${/LineItems}

PDF (HTML)

Wrap the repeating rows in HTML comments.

<!-- ${#LineItems} -->
<tr>
  <td>${ItemName}</td>
  <td>${Qty}</td>
  <td>${UnitPrice currency="USD"}</td>
</tr>
<!-- ${/LineItems} -->

Iterate over related records fields using the same syntax as subtables.

Nested loops in DOCX

${#RelatedProjects}
  ${ProjectName}
  | ${#LineItems} | ${ItemName} | ${Qty} | ${/LineItems} |
${/RelatedProjects}

Nested loops in PDF (HTML)

<!-- ${#RelatedProjects} -->
<tr><td>${ProjectName}</td><td>${Owner}</td></tr>
  <!-- ${#LineItems} -->
  <tr><td colspan="2" style="padding-left:2em">${ItemName} (${Qty})</td></tr>
  <!-- ${/LineItems} -->
<!-- ${/RelatedProjects} -->

Note: Nested loops within related records are not supported in XLSX.


Generating Documents

Using a Button Trigger

  1. Open the record detail screen
  2. Click the configured button (e.g., "Create Invoice")
  3. The generation runs (may take a few seconds to tens of seconds)
  4. On completion, the file is saved to the specified attachment field

Using a Status Change Trigger

  1. Change the process management status on the record detail screen
  2. Document generation runs automatically when the target status is reached
  3. If Auto Execute is OFF: a confirmation dialog appears — click OK to generate or Cancel to skip

Bulk Generation from the Record List

When "Enable bulk output from list" is ON, a bulk output button appears on the record list screen.

Steps:

  1. Apply filters on the record list screen (optional)
  2. Click the bulk output button
  3. A confirmation dialog shows the number of records to process — click OK to start
  4. A progress overlay shows Bulk generating: X / Y records
  5. A toast notification shows the success/failure count when complete

Notes:

  • Without filters, all records in the app are processed
  • Maximum records per run: 10,000 (kintone REST API limit)
  • Do not navigate away from the page during processing

Notes and Limitations

Settings Size Limit

kintone plugin settings are limited to 256 KB. Check the size meter at the top of the settings screen, especially when using large HTML templates for PDF output.

PDF Japanese Fonts

html2pdf.js uses the browser's fonts. For print environments that require embedded fonts, consider using DOCX-to-PDF conversion instead.

Display Language

The settings screen automatically displays in Japanese or English based on the logged-in user's language setting.


Troubleshooting

Document is not generated

Check:

  • Plugin settings are saved (did you click Save?)
  • Template storage app ID, record ID, field code, and filename are correct
  • The attachment field code in the output target is correct

Field value is not inserted (tag appears in output)

Check:

  • Field code exactly matches the kintone form settings (case-sensitive, no extra spaces)
  • View field codes in the app's form settings

Tags not converted in DOCX / XLSX (appear as-is)

Check:

  • No space between $ and { ($ {fieldCode} is invalid)
  • Word/Excel autocorrect has not modified ${ (try typing $ and { separately)
  • No full-width spaces inside the tag

Excel template outputs blank rows

Check:

  • Loop marker rows (${#~} / ${/~}) are properly paired
  • The field code in the markers matches the actual subtable field code

PDF layout is broken

Check:

  • Page size and orientation settings are correct
  • Use page-break-* CSS properties to control page breaks in HTML templates
  • Complex CSS layouts (flexbox, grid) may not render correctly — use table-based layouts instead

Date is not formatted correctly

Check:

  • The format option string is valid (follows Day.js format tokens)
  • For non-date fields, the value must be in ISO format (YYYY-MM-DD) for formatting to work