Umitake Document Generator for Kintone — User Manual
Table of Contents
- Overview
- Installation
- Plugin Configuration
- Preparing Templates
- Template Tag Reference
- Generating Documents
- Notes and Limitations
- 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
- Open the kintone admin console (gear icon)
- Click Plugins
- Click Import Plugin
- Select and upload
kintone-doc-generator.zip - After uploading, open the settings for the target app
- From the Plugins tab, add "Document Generator"
- 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:
| Button | Action |
|---|---|
| ⧉ | 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:
- Create a new kintone app (e.g., "Template Manager")
- Add an Attachment field (e.g., field code:
template_file) - Attach your template file (.docx or .xlsx) to a record and save
- Note the record number from the record URL
Plugin configuration example (invoice template):
| Field | Value |
|---|---|
| App ID | 100 (the template storage app's ID) |
| Record ID | 1 (the record the template is attached to) |
| Field Code | template_file |
| File Name | invoice_template.docx |
PDF templates can be specified in three ways:
| Method | Description |
|---|---|
| From HTML | Write HTML directly in the built-in HTML editor |
| From DOCX | Use a DOCX template; converted to PDF by the backend service |
| From XLSX | Use 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:
| Setting | Options |
|---|---|
| Page size | A4 / A3 / Letter |
| Orientation | Portrait / 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)
| Field | Description |
|---|---|
| Field Code | The attachment field code to save the file to |
| Append Mode | ON: add to existing files / OFF: overwrite |
Another App
| Field | Description | Example |
|---|---|---|
| App ID | Target app ID | — |
| Attachment Field Code | Attachment field in the target app | — |
| Record Query | kintone query to identify the target record (field tags supported) | customer_code = "${CustomerCode}" |
| App ID Storage Field | Field to store the source app ID on new record creation (optional) | — |
| Record ID Storage Field | Field to store the source record ID on new record creation (optional) | — |
| Append Mode | ON: 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.
| Field | Description |
|---|---|
| Button Label | Text displayed on the button (e.g., Create Invoice) |
| Position | Header menu / Bottom of screen |
| Enable bulk output from list | When ON, a bulk output button appears on the record list screen |
| Bulk output button label | Label for the list-screen button (defaults to Button Label if empty) |
Status Change
Runs when a process management status changes.
| Field | Description |
|---|---|
| Target Status | The status name after the change (e.g., Approved) |
| Auto Execute | ON: 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):
| Row | Col A | Col B | Col C | Col 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:
| Option | Value | Default | Target Fields | Description |
|---|---|---|---|---|
format | Day.js format string | — | Date, datetime, @date, @datetime | Output format for date/time values (e.g., "MMMM D, YYYY") |
timezone | Timezone name | Browser TZ | Date, datetime, @date, @datetime | Output timezone (e.g., "America/New_York") |
currency | Currency code | — | Number | Format with currency symbol and thousand separators (JPY, USD, EUR, GBP, etc.) |
number | "true" / decimal places | — | Number | Format with thousand separators but no currency symbol ("2" = 2 decimal places, "true" = integer) |
separator | Any string | ", " | Checkbox, multi-select, user/org/group select | Delimiter for array fields ("\n" for newline) |
prefix | Any string | — | All fields | Text prepended only when field has a value |
suffix | Any string | — | All fields | Text appended only when field has a value |
key | Property name | name | User/org/group select | Object property to extract ("name", "code", etc.) |
allOptions | (flag) | — | Checkbox, multi-select | Output all options with checked/unchecked marks |
checked | Any string | "☑" | With allOptions | Mark for selected options |
unchecked | Any string | "☐" | With allOptions | Mark for unselected options |
image | (flag) | — | Attachment | Embed attached image in the document |
index | Integer | 0 | Attachment (with image) | Index of the file to use when multiple files are attached (0-based) |
width | Pixels | 200 | image, qrcode, barcode | Image width in pixels |
height | Pixels | 150 | image, barcode | Image height in pixels |
qrcode | (flag) | — | Any field | Generate a QR code from the field value |
barcode | (flag) | — | Any field | Generate a barcode from the field value |
type | Barcode format | "CODE128" | With barcode | Barcode symbology |
Basic Tags
${fieldCode}
Use the kintone field code exactly as shown in the form settings.
Supported field types:
| Field Type | Output |
|---|---|
| Text (single/multi-line) | Entered text |
| Number | Numeric string |
| Date / Datetime / Time | ISO format (e.g., 2024-01-15) — use format to reformat |
| Link | URL string |
| Radio / Dropdown | Selected value |
| Checkbox / Multi-select | Comma-separated selected values |
| User / Org / Group select | Comma-separated names |
| Lookup | Referenced value |
| Calculated | Calculated result |
| Attachment | Use image option to embed images |
| Subtable | Use loop tags |
| Related records | Use loop tags |
Date Format
${fieldCode format="format-string"}
| Format token | Meaning | Example |
|---|---|---|
YYYY | 4-digit year | 2024 |
YY | 2-digit year | 24 |
MM | Month (2-digit) | 01 |
M | Month | 1 |
DD | Day (2-digit) | 05 |
D | Day | 5 |
HH | Hour (24h) | 14 |
mm | Minute | 30 |
ss | Second | 00 |
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 Code | Example 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 value | Example output | Description |
|---|---|---|
"true" or "0" | 1,234,567 | Integer with thousand separators |
"1" | 1,234.6 | 1 decimal place |
"2" | 1,234,567.89 | 2 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}
| Tag | Default output | Description |
|---|---|---|
${@date} | 2024-01-15 | Generation date |
${@datetime} | 2024-01-15 09:30:00 | Generation 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=", "}
| City | State | Country | Output |
|---|---|---|---|
| Austin | TX | USA | Austin, TX, USA |
| Austin | USA | Austin, USA | |
| Austin | Austin |
${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 type | key value | Output |
|---|---|---|
| User select | name (default) | Display name |
| User select | code | Login ID |
| Org select | name (default) | Organization name |
| Org select | code | Organization 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"}
| Option | Default | Description |
|---|---|---|
index | 0 | Index of the file when multiple files are attached (0-based) |
width | 200 | Image width in pixels |
height | 150 | Image height in pixels |
Format-specific notes:
| Format | Notes |
|---|---|
| PDF (HTML) | Supported formats: JPEG, PNG, GIF, WebP |
| DOCX | The tag must be in a single text run. Do not apply formatting (bold, color, etc.) to image tags |
| XLSX | Only 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 value | Format | Use case |
|---|---|---|
CODE128 | Code 128 | General purpose, alphanumeric (default) |
EAN13 | EAN-13 | Retail product barcodes (13 digits) |
EAN8 | EAN-8 | Compact retail barcodes (8 digits) |
UPC | UPC-A | North American retail barcodes (12 digits) |
CODE39 | Code 39 | Alphanumeric, medical/industrial use |
ITF14 | ITF-14 | Logistics / 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
| Syntax | True 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).
| Row | Col A | Col B | Col 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} -->
Related Records Loop Expansion
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
- Open the record detail screen
- Click the configured button (e.g., "Create Invoice")
- The generation runs (may take a few seconds to tens of seconds)
- On completion, the file is saved to the specified attachment field
Using a Status Change Trigger
- Change the process management status on the record detail screen
- Document generation runs automatically when the target status is reached
- 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:
- Apply filters on the record list screen (optional)
- Click the bulk output button
- A confirmation dialog shows the number of records to process — click OK to start
- A progress overlay shows
Bulk generating: X / Y records - 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
formatoption 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
