Umitake Document Generator for Kintone — User Manual
Table of Contents
- Overview
- Installation
- Plugin Configuration
- Preparing Templates
- Template Tag Reference
- Generating Documents
- Label Printing
- 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
- Label printing — pack multiple records onto DOCX label sheets (N records per sheet), downloaded as a single ZIP
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.
Inserting a line break
Write \n inside an option value to produce a line break. A tag has to stay on a single
line to be parsed, so a real newline cannot be typed inside the option itself.
${name suffix="\n"}${address}
${tags separator="\n"}
| Escape | Meaning |
|---|---|
\n | Line break |
\t | Tab |
\\ | A literal backslash \ |
Besides prefix and suffix, this also works in separator for array fields.
Note for Excel (xlsx) The line break is written into the cell, but Excel only displays it when that cell's format has Wrap Text enabled — set this in your template. Word (docx) and PDF need no extra setup.
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}
More than two branches (else if)
There is no ${#elseif}. Nest an ${#if} inside the ${#else} instead:
${#if Amount > 10000}High
${#else}${#if Amount > 0}Normal
${#else}None${/if}${/if}
| Amount | Output |
|---|---|
| 20000 | High |
| 5000 | Normal |
| 0 | None |
There is no limit on nesting depth — one ${/if} is required per ${#if} opened.
Warning: Writing
${#elseif ...}makes Word (DOCX) generation fail outright with a template error. Always use the nested form above.
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. You cannot place a
${#if}block inside another${#if}block.
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
Label Printing
This is a separate mechanism from the usual "one record → one document" generation model. It packs a large number of records (e.g., 90 book records) onto DOCX or XLSX sheets that each have multiple label slots, producing one sheet per group of records, and bundles every generated sheet into a single ZIP for download.
Overview:
- The target is every record matching the current list view's filter
- Records are grouped into batches of "records per sheet," and one file is generated per batch
- All generated sheets are bundled into a single ZIP and downloaded directly by the browser (files are not saved to any kintone record)
- Output format can be chosen as "same format as the template" (DOCX/XLSX) or "PDF"
Adding a Label Print Configuration
Click "+ Add Label Print Configuration" at the bottom of the settings screen. Label print configurations are managed in a separate list from regular document configurations.
| Field | Description |
|---|---|
| Document Name | Identifying name for the configuration. Used directly as the button label on the list view |
| Template Format | DOCX or XLSX |
| Template Source | An attachment in another app. Specify App ID, Record ID, Field Code, and Filename — the file must match the Template Format above |
| Output Format | Same as template / PDF. When PDF is selected, converting DOCX/XLSX to PDF uses the same backend conversion service as single-record PDF output (requires a valid license) |
| Records per Sheet | Must match the number of label slots on the template (e.g., 30) |
| Confirm skip count when printing | When enabled, a dialog asks how many slots to skip each time you click the print button (for continuing to print onto a partially-used sticker sheet). When disabled, this dialog never appears |
| Default slots to skip | The default value shown in that dialog, when the above is enabled. Must be less than the records-per-sheet count |
| Filename Template | Filename for each sheet inside the ZIP. ${index} (sheet number) and ${total} (total sheet count) are available (e.g., label_${index}). The extension is added automatically based on the output format |
Preparing the Template (Label Printing)
Each label slot's tags use the field code with the slot number prefixed. The tag syntax and slot-numbering convention are identical for DOCX and XLSX templates:
${1_book_id}
${1_book_title}
${1_book_id barcode type="CODE128" height="25"}
${2_book_id}
${2_book_title}
${2_book_id barcode type="CODE128" height="25"}
... (repeat for every slot on the template) ...
${30_book_id}
${30_book_title}
${30_book_id barcode type="CODE128" height="25"}
Why the number is prefixed: kintone field codes can never start with a digit, so the
N_field_codeformat can never collide with a real field code. (A suffix format likebook_id_1could be confused with a genuinely different field that happens to share that name.)
Standard tag options described in Template Tag Reference — date/currency formatting, barcodes, QR codes, and so on — work the same way inside each slot's tags (e.g., ${1_created_at format="YYYY/MM/DD"}).
Generating from the Record List (Label Printing)
- Apply filter conditions on the record list screen
- Click the configured label print button (the document name is used as the button label)
- If "Confirm skip count when printing" is enabled for this configuration, a dialog asks how many slots to skip (defaulting to the value from the settings screen; configurations with this disabled never show this dialog)
- A confirmation dialog shows the number of matching records and the number of sheets that will be generated — click "OK" to proceed
- Progress is displayed as an overlay
- When complete, a ZIP file containing all sheets is downloaded automatically
Notes:
- If the number of matching records for the final sheet is less than "records per sheet," the remaining slots on that sheet are left blank
- When a skip count is specified, only the first sheet's leading slots are left blank. Later sheets fill normally starting from slot 1
- Generated files are not saved to any kintone record — the ZIP is downloaded only
- The target is every record matching the current list view's filter. As with bulk output, the kintone REST API limits processing to a maximum of 10,000 records at once
- Selecting PDF as the output format uses the backend conversion service and requires a valid license
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
