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
Umitake Document Generator for Kintone 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 screen — 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 "Umitake Document Generator for Kintone"
Plugin Configuration
Click Settings for Umitake Document Generator for Kintone 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.
Each configuration card has the following action buttons in the header:
| Button | Action |
|---|---|
| ⧉ | Duplicate the configuration (creates a copy immediately below) |
| ↑ / ↓ | Change the order of configurations |
| × | Delete the configuration |
Template Source
The method for specifying the template differs by output format.
For DOCX / XLSX
Template files are stored as attachments in a separate kintone app (template storage app).
Preparing the template storage app:
- Create a new kintone app (e.g., "Template Management")
- Add an attachment field
- Attach the template file (.docx or .xlsx) to a record and save
- Note the record number from the record URL (e.g.,
1)
Settings in the plugin configuration:
| Field | Description | Example |
|---|---|---|
| App ID | ID of the template storage app | 100 |
| Record ID | Record number where the template is attached | 1 |
| Field Code | Field code of the attachment field | template_file |
| Filename | Filename of the attachment (to identify when multiple files exist) | invoice_template.docx |
For PDF
Three template source options are available for PDF output:
| Method | Description |
|---|---|
| Create from HTML | Write HTML directly in the HTML editor on the configuration screen |
| Create from DOCX | Generate from a DOCX template and convert to PDF via the backend service |
| Create from XLSX | Generate from an XLSX template and convert to PDF via the backend service |
Create from HTML:
Write HTML in the HTML editor on the configuration screen. Field tags can be inserted from the field list panel.
Page settings:
| Field | Options |
|---|---|
| Page Size | A4 / A3 / Letter |
| Orientation | Portrait / Landscape |
Create from DOCX / Create from XLSX:
Create a DOCX or XLSX template using the same format as DOCX/XLSX output, and store it in the template storage app. The configuration fields are the same as for DOCX/XLSX output (App ID, Record ID, Field Code, Filename).
Note: Converting DOCX/XLSX to PDF requires the backend conversion service and a valid license.
Output Target
Specify where to save the generated file.
Same App (Attachment Field)
| Field | Description |
|---|---|
| Field Code | Attachment field to save the file to |
| Append Mode | ON: keep existing files and add / OFF: overwrite |
Example: Field code generated_docs, Append Mode ON
Another App
| Field | Description | Example |
|---|---|---|
| App ID | ID of the destination app (select from list) | — |
| Attachment Field Code | Attachment field in the destination app (select from list) | — |
| Record Identifier Query | kintone query to identify the target record (field tags supported) | customer_code = "${customer_code}" |
| Field to store source app ID | Field to write the source app ID when creating a new record (single-line text or number, optional) | — |
| Field to store source record ID | Field to write the source record ID when creating a new record (single-line text, number, or lookup, optional) | — |
| Append Mode | ON: keep existing files and add / OFF: overwrite | — |
Field tags (${field_code}) can be used in the query. If the query matches multiple records, the file is saved to the first record found.
When the query is empty or no records match: A new record is created in the destination app and the file is saved to it. If you specify "Field to store source app ID" and "Field to store source record ID", the source app ID and record ID ($id) are automatically written to those fields when a new record is created. Using a lookup field allows you to copy related values at the same time.
Filename Template
Specify the filename for the generated document. Use field tags and system date tags to create dynamic filenames.
Invoice_${customer_name}_${invoice_date format="YYYYMMDD"}
Report_${@date format="YYYYMMDD"}
The file extension (.docx, .xlsx, .pdf) is added automatically — you do not need to include it.
The ${@date} and ${@datetime} tags can be used to include the generation date or time in the filename (the format option is also supported). See System Date and Time Tags for details.
Tip: OS-reserved characters that are invalid in filenames (
/,\,:,*,?,",<,>,|) are automatically replaced with underscores.
Output Trigger
Choose when document generation is triggered.
Button
Displays a button on the record detail screen.
| Field | Description |
|---|---|
| Button Label | Text displayed on the record detail button (e.g., Create Invoice) |
| Button position | Header (default) / Space field |
| Space field element ID | Used when position is "Space field". The element ID of a Space field placed on the form layout (find/set it by double-clicking the Space field in kintone's form settings and opening its advanced settings). To show the button on mobile too, place the same Space field on the mobile layout as well. If the element ID is empty, wrong, or the field can't be found, the button falls back to the header |
| Enable bulk output on list view | When ON, a bulk output button also appears on the record list screen |
| Bulk output button label | Text for the list-view bulk button (falls back to Button Label if left empty). This bulk button and the list-view label print button always appear in the header menu (Space fields are a record-detail-only feature) |
Status Change
Executes when a process management status changes.
| Field | Description |
|---|---|
| Target Status | The name of the status after the change (e.g., Approved) |
| Auto Execute | ON: run immediately without confirmation / OFF: show a 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
${field_code} - Enter tags as plain text, not as Word "Fields"
- Font, size, color, and other formatting applied to a tag is preserved in the output
- Subtable loops are written in table rows
Example (Invoice):
Invoice
Bill To: ${customer_name}
Invoice Date: ${invoice_date format="MMMM D, YYYY"}
Due Date: ${due_date format="MMMM D, YYYY"}
| Item | Qty | Unit Price | Amount |
|------|-----|------------|--------|
| ${#line_items} | ${item_name} | ${qty} | ${unit_price currency="USD"} | ${amount currency="USD"} | ${/line_items} |
Total: ${total_amount currency="USD"}
XLSX Template
Create an .xlsx file in Excel and write tags in individual cells.
Basic rules:
- Write one tag per cell
- Cell formatting (font, background color, borders, number format, etc.) is preserved
Subtable loop:
Loops consist of "marker rows" and "template rows" written on separate rows.
| Row | Column A | Column B | Column C | Column D |
|---|---|---|---|---|
| 10 | ${#line_items} | |||
| 11 | ${item_name} | ${qty} | ${unit_price currency="USD"} | ${amount currency="USD"} |
| 12 | ${/line_items} |
- Marker rows (rows containing only
${#...}or${/...}) are not included in the output - Template rows are duplicated for each row in the subtable
- Multiple template rows can be placed between markers to expand multiple output rows per subtable row
- If a marker row contains other cell content, that content is also included in the output
PDF Template
Three methods are available for PDF generation.
Create from HTML
Write HTML in the HTML editor on the plugin configuration screen.
Tips:
- Use the "Fullscreen" button (top-right of the editor) to expand to a full-screen modal
- Use CSS to control fonts and layout
- Japanese fonts use the browser's default font
Subtable loop:
Enclose the loop range with HTML comments.
<table>
<tr>
<th>Item</th>
<th>Qty</th>
<th>Unit Price</th>
</tr>
<!-- ${#line_items} -->
<tr>
<td>${item_name}</td>
<td>${qty}</td>
<td>${unit_price currency="USD"}</td>
</tr>
<!-- ${/line_items} -->
</table>
Create from DOCX
Create a DOCX template using the same tag syntax and loop format as DOCX output. The generated DOCX is converted to PDF by the backend conversion service.
→ See DOCX Template for how to prepare the template.
Create from XLSX
Create an XLSX template using the same tag syntax and loop format as XLSX output. The generated XLSX is converted to PDF by the backend conversion service.
→ See XLSX Template for how to prepare the template.
Template Tag Reference
Options Reference
Options are added to a tag in the form option_name="value". Flag-type options (image, qrcode, barcode, allOptions) are written without a value.
${field_code option_name="value" another_option="value"}
${field_code image}
${field_code allOptions checked="☑" unchecked="☐"}
All options:
| Option | Value | Default | Applicable Fields | Description |
|---|---|---|---|---|
format | Day.js format string | — | Date / Date-time / @date / @datetime | Output format for dates and times (e.g., "MMMM D, YYYY") |
timezone | Timezone name | Browser TZ | Date / Date-time / @date / @datetime | Output timezone (e.g., "America/New_York", "Asia/Tokyo") |
currency | Currency code | — | Number | Format with currency symbol and thousands separator (JPY, USD, EUR, GBP, etc.) |
number | "true" / decimal places | — | Number | Thousands separator without currency symbol ("2" = 2 fixed decimal places, "true" = integer) |
separator | Any string | ", " | Check box / Multi-select / User/Org/Group select | Delimiter between array values ("\n" for line breaks) |
prefix | Any string | — | All fields | String prepended to the value only when the field is not empty |
suffix | Any string | — | All fields | String appended to the value only when the field is not empty |
key | Property name | name | User select / Organization select / Group select | Object property to extract ("name", "code", etc.) |
allOptions | (flag) | — | Check box / Multi-select | Output all choices with checked/unchecked markers |
checked | Any string | "☑" | When using allOptions | Marker prepended to selected items |
unchecked | Any string | "☐" | When using allOptions | Marker prepended to unselected items |
image | (flag) | — | Attachment | Embed the attached image in the document |
index | Integer | 0 | Attachment (when using image) | Index of the file to use when multiple files are attached (0-based) |
width | Pixels | 200 | image / qrcode / barcode | Width of the inserted image in pixels |
height | Pixels | 150 | image / barcode | Height of the inserted image in pixels |
qrcode | (flag) | — | Any field | Generate and insert a QR code from the field value |
barcode | (flag) | — | Any field | Generate and insert a barcode from the field value |
type | Barcode format | "CODE128" | When using barcode | Barcode symbology (see QR Code and Barcode) |
Basic Tags
${field_code}
Write the kintone field code directly. Field codes can be found in your kintone form settings.
Supported field types:
| Field Type | Output |
|---|---|
| Single-line text / Multi-line text | Input text |
| Number | Numeric value (as string) |
| Date / Date and time / Time | ISO format (e.g., 2024-01-15) — use format option to convert |
| Link | URL string |
| Radio button / Drop-down | Selected value |
| Check box / Multi-select | Selected values joined with comma |
| User select / Organization select / Group select | Names joined with comma |
| Lookup | Referenced value |
| Calculated | Calculation result |
| Attachment | Insert images with the image option (see Image Insertion) |
| Subtable | Expanded via loop tags |
| Related records | Expanded via loop tags |
Date Format
${field_code format="format_string"}
Formats date/datetime field values using the specified format string.
| Token | Meaning | Example |
|---|---|---|
YYYY | 4-digit year | 2024 |
YY | 2-digit year | 24 |
MM | Month (2 digits) | 01 |
M | Month | 1 |
DD | Day (2 digits) | 05 |
D | Day | 5 |
HH | Hour (24h) | 14 |
mm | Minute | 30 |
ss | Second | 00 |
ddd | Abbreviated day name | Mon |
dddd | Full day name | Monday |
MMMM | Full month name | January |
Examples:
${invoice_date format="MMMM D, YYYY"} → January 15, 2024
${invoice_date format="MM/DD/YYYY"} → 01/15/2024
${updated_at format="YYYY-MM-DD HH:mm"} → 2024-01-15 14:30
Combine with the timezone option to output in a specific timezone:
${updated_at format="YYYY-MM-DD HH:mm" timezone="America/New_York"}
Currency Format
${field_code currency="currency_code"}
Formats a numeric field value with a currency symbol.
| 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
${total currency="JPY"} → ¥1,234,567
Number Format
${field_code number="option"}
Formats a number with thousands separators and optional fixed decimal places (no currency symbol).
| Option Value | Example Output | Description |
|---|---|---|
"true" or "0" | 1,234,567 | Integer with thousands separator |
"1" | 1,234.6 | Fixed 1 decimal place |
"2" | 1,234,567.89 | Fixed 2 decimal places |
${quantity number="true"} → 1,234
${unit_price number="2"} → 1,234.00
${rate number="1"} → 98.5
System Date and Time Tags
Outputs the date or time at the moment document generation is executed. These are system tags, not kintone fields.
${@date}
${@datetime}
| Tag | Default Output Example | Description |
|---|---|---|
${@date} | 2024-01-15 | Generation date |
${@datetime} | 2024-01-15 09:30:00 | Generation date and time |
Combine with the format and timezone options:
${@date format="MMMM D, YYYY"} → January 15, 2024
${@datetime format="MM/DD/YYYY HH:mm"} → 01/15/2024 09:30
${@date timezone="America/Chicago"} → 2024-01-14 (due to offset)
${@datetime format="HH:mm" timezone="Asia/Tokyo"} → 18:30
Example for file names:
Invoice_${CustomerName}_${@date format="YYYYMMDD"}
Conditional Prefix and Suffix
${field_code prefix="prefix_string"}
${field_code suffix="suffix_string"}
Appends text before or after a field value only when the field is not empty. If the field is null or an empty string, the entire tag outputs nothing. This is useful for joining multiple address fields without stray separators when some are empty.
Example:
${address}${city prefix=", "}${state prefix=", "}
| address | city | state | Output |
|---|---|---|---|
| 1111 ABC St. | San Francisco | CA | 1111 ABC St., San Francisco, CA |
| 1111 ABC St. | (empty) | CA | 1111 ABC St., CA |
| 1111 ABC St. | (empty) | (empty) | 1111 ABC St. |
prefix and suffix can be combined:
${notes prefix="[Note: " suffix="]"}
If notes has a value, it outputs [Note: ...]. If empty, nothing is output.
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
Check box, multi-select, user select, and similar array fields are joined with , (comma + space) by default. Use the options below to control the output format.
separator — Custom delimiter
${field_code separator="delimiter"}
${tags} → Design, Engineering, Sales
${tags separator=" / "} → Design / Engineering / Sales
${assignees separator=" | "} → Alice | Bob
${categories separator="\n"} → line-break separated
Applicable field types: Check box, Multi-select, User select, Organization select, Group select
key — Extract a specific property from object arrays
User select, Organization select, and Group select fields are arrays of objects internally. By default, the name (display name) property is output. Use the key option to change which property is extracted.
${assignees key="code"} → user login IDs
${assignees key="name"} → display names (default)
${org_select key="code"} → organization codes
Common property values:
| Field Type | key value | Output |
|---|---|---|
| User select | name (default) | Display name |
| User select | code | Login ID |
| Organization select | name (default) | Organization name |
| Organization select | code | Organization code |
| Group select | name (default) | Group name |
| Group select | code | Group code |
Combine with separator as needed:
${assignees key="code" separator=","} → user1,user2,user3
allOptions — Display all check box choices
Outputs all choices of a Check box or Multi-select field with checked/unchecked markers. Useful for displaying survey responses or checklists.
${field_code allOptions}
${field_code allOptions checked="☑" unchecked="☐" separator="\n"}
Option details:
| Option | Default | Description |
|---|---|---|
checked | ☑ | Marker prepended to selected items |
unchecked | ☐ | Marker prepended to unselected items |
separator | \n (line break) | Delimiter between choices |
Example (Check box has choices A, B, C — A and C are selected):
${checkbox allOptions}
→
☑ Choice A
☐ Choice B
☑ Choice C
${checkbox allOptions checked="✅" unchecked="⬜" separator=", "}
→ ✅ Choice A, ⬜ Choice B, ✅ Choice C
Note:
allOptionsfetches the field definition (choice list) from the kintone form API. The user must have permission to read form field definitions.
Image Insertion
Embeds images from a kintone attachment field into the document.
${field_code image}
${field_code image index="0" width="200" height="150"}
Option details:
| Option | Default | Description |
|---|---|---|
index | 0 | Index of the file to use when multiple files are attached (0-based) |
width | 200 | Width of the inserted image in pixels |
height | 150 | Height of the inserted image in pixels |
Examples:
${product_image image} → first image at 200×150 px
${product_image image index="1" width="300"} → second image, 300 px wide
${employee_photo image width="100" height="120"} → 100×120 px
Format-specific behavior:
| Format | Behavior | Notes |
|---|---|---|
| PDF (HTML) | Inserted as an <img> element | Supported types: JPEG, PNG, GIF, WebP |
| DOCX | Inserted as <w:drawing> in a paragraph | The tag must exist in a single text run. Word formatting that splits the run may prevent insertion |
| XLSX | Inserted anchored to the cell position | Only works with inline-string cells (cells typed directly in Excel). Shared-string cells are not supported |
Tip: Avoid applying character formatting (bold, color, etc.) to image tags in DOCX templates — Word may split the run internally, which prevents tag detection.
QR Code and Barcode
Generates a QR code or barcode from a field value and inserts it into the document.
QR Code
${field_code qrcode}
${field_code qrcode width="150"}
| Option | Default | Description |
|---|---|---|
width | 150 | Size of the QR code (pixels). Width and height are equal |
Barcode
${field_code barcode}
${field_code barcode type="CODE128" width="200" height="80"}
| Option | Default | Description |
|---|---|---|
type | CODE128 | Barcode symbology (see table below) |
width | 200 | Width of the barcode in pixels |
height | 80 | Height of the barcode in pixels |
Supported barcode formats:
type value | Format | Use case |
|---|---|---|
CODE128 | Code 128 | General-purpose alphanumeric barcode (default) |
EAN13 | EAN-13 | Retail product barcode (13 digits) |
EAN8 | EAN-8 | Compact retail barcode (8 digits) |
UPC | UPC-A | North American retail barcode (12 digits) |
CODE39 | Code 39 | Alphanumeric, used in healthcare and industry |
ITF14 | ITF-14 | Logistics/shipping barcode for cartons |
MSI | MSI | Warehouse and shelf management |
pharmacode | Pharmacode | Pharmaceutical packaging barcode |
Examples:
${product_code barcode} → CODE128 barcode (200×80 px)
${ean_code barcode type="EAN13" width="250"} → EAN-13 barcode (250×80 px)
${url qrcode width="200"} → QR code (200×200 px)
Note: If the field value is empty, no image is inserted. Some barcode formats restrict the allowed character set and length (e.g., EAN13 requires exactly 13 digits).
Conditional Blocks (IF/IFEXIST)
Show or hide parts of the document based on field values.
Syntax
Basic (show if field has a value):
${#if field_code}
Content shown when the field has a value
${/if}
Comparison operators:
${#if field_code = "value"}...${/if}
${#if field_code != "value"}...${/if}
${#if field_code > 100}...${/if}
${#if field_code >= 100}...${/if}
${#if field_code < 100}...${/if}
${#if field_code <= 100}...${/if}
Contains / does not contain (check boxes, multi-choice, etc.):
${#if field_code contains "value"}...${/if}
${#if field_code !contains "value"}...${/if}
For fields that hold multiple values (Check box, Multi-choice, User selection, …), tests whether
the given value is selected. (= compares the whole value, so it never matches when several
options are selected.)
${#if Favorites contains "Apple"}☑${#else}☐${/if} Apple
contains must be surrounded by spaces. On a text field it performs a substring match.
else block:
${#if field_code = "Approved"}
Document is approved
${#else}
Pending review
${/if}
IFEXIST (field existence check):
${#ifexist field_code}
Shown when the 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. You need one ${/if} per ${#if} you opened.
Warning: Writing
${#elseif ...}makes Word (docx) generation fail outright with a template error. Always use the nested form above.
Condition behavior
| Syntax | Evaluates to true when |
|---|---|
${#if FIELD} | Field value is not empty and not "0" |
${#ifexist FIELD} | Field exists and value is not empty ("0" counts as true) |
${#if FIELD = "value"} | Exact string match |
${#if FIELD != "value"} | String does not match |
${#if FIELD > number} | Numeric comparison (greater than) |
${#if FIELD >= number} | Numeric comparison (greater than or equal) |
${#if FIELD < number} | Numeric comparison (less than) |
${#if FIELD <= number} | Numeric comparison (less than or equal) |
${#if FIELD contains "value"} | Array field has the value as one of its elements (substring match on text fields) |
${#if FIELD !contains "value"} | Negation of the above |
Format-specific syntax
DOCX (Word Template):
Write the block at the paragraph level. Put ${#if ...} and ${/if} on separate paragraphs (separate lines). When the condition is false, all paragraphs in the block are removed.
${#if status = "Approved"}
Approved on: ${approved_date format="MMMM D, YYYY"}
${#else}
(Pending review)
${/if}
${#ifexist notes}
Notes: ${notes}
${/ifexist}
Blocks can be nested. You need one ${/if} per ${#if} you opened.
${#if order_size contains "Minimum Order Qty"}
MOQ heading
${#if unit contains "Impressions"}
MOQ impressions line
${/if}
${#if unit contains "Feet"}
MOQ feet line
${/if}
${/if}
Showing or hiding tables:
- Whole table: Put
${#if ...}in the paragraph before the table and${/if}in the paragraph after it. When the condition is false, the entire table is removed. - Single row: Put
${#if ...}in the first cell of a table row and${/if}in the last cell of the same row. When the condition is false, that row is removed (the same placement as a subtable loop).
| Item | Amount |
|---|---|
| Base fee | ${base_fee} |
${#if options contains "Maintenance"}Maintenance fee | ${maintenance_fee}${/if} |
| Total | ${total} |
You can also place per-row ifs inside an if block that wraps the whole table.
Note:
${#else}cannot be used in a per-row if (it causes a template error). Always put the opening and closing tags in cells of the same row.
XLSX (Excel Template):
Control blocks at the row level. Write ${#if ...} and ${/if} in cells on separate rows. When the condition is false, the rows in the block are removed.
| Row | Column A |
|---|---|
| N | ${#if status = "Approved"} |
| N+1 | Approved content |
| N+2 | ${/if} |
PDF (HTML Template):
Enclose blocks with HTML comments.
<!-- ${#if status = "Approved"} -->
<p style="color:green">Approved (date: ${approved_date format="MM/DD/YYYY"})</p>
<!-- ${#else} -->
<p style="color:gray">Pending review</p>
<!-- ${/if} -->
<!-- ${#ifexist notes} -->
<p><strong>Notes:</strong> ${notes}</p>
<!-- ${/ifexist} -->
Examples:
${#if total_amount >= 10000}
Free shipping applied (order over $100)
${/if}
${#if assignee = "alice"}
Assignee: Alice (ext. 1234)
${#else}
Assignee: ${assignee}
${/if}
Note: Nested conditional blocks are not supported for XLSX row-level blocks (
${#if}and${/if}on separate rows) or for PDF (HTML comment blocks). You cannot place a${#if}block inside another block there. DOCX blocks, and${#if}written inside a single XLSX cell, can be nested.
Subtable Loop Expansion
Repeats output for each row in a subtable field. The syntax differs by output format.
DOCX (Word Template)
Write the start tag, field tags, and end tag all in a single table row.
| ${#line_items} | ${item_name} | ${qty} | ${unit_price currency="USD"} | ${/line_items} |
${#subtable_code}— Loop start${/subtable_code}— Loop end- The row is repeated once for each subtable row
XLSX (Excel Template)
Write marker rows (start/end) and template rows (data) on separate rows.
| Row | Column A | Column B | Column C |
|---|---|---|---|
| N | ${#line_items} | ||
| N+1 | ${item_name} | ${qty} | ${unit_price currency="USD"} |
| N+2 | ${/line_items} |
Marker-only rows are not included in the output. Template rows are duplicated for each subtable row.
PDF (HTML Template)
Enclose the repeating section with HTML comments.
<!-- ${#line_items} -->
<tr>
<td>${item_name}</td>
<td>${qty}</td>
<td>${unit_price currency="USD"}</td>
</tr>
<!-- ${/line_items} -->
Related Records Loop Expansion
Repeats output for each record in a related records field (REFERENCE_TABLE). Uses the same syntax as subtable loops.
DOCX (Word Template)
Uses the same syntax as subtable loops.
| ${#related_projects} | ${project_name} | ${assignee} | ${/related_projects} |
If a related record contains a subtable, nested loops are supported:
${#related_projects}
${project_name}
| ${#line_items} | ${item_name} | ${qty} | ${/line_items} |
${/related_projects}
XLSX (Excel Template)
Uses the same marker row / template row format as subtable loops.
| Row | Column A | Column B | Column C |
|---|---|---|---|
| N | ${#related_projects} | ||
| N+1 | ${project_name} | ${assignee} | ${amount currency="USD"} |
| N+2 | ${/related_projects} |
Note: In XLSX, subtable fields inside related records output as empty (nested loops not supported).
PDF (HTML Template)
Enclose with HTML comments. Subtable loops inside related records can be nested.
<!-- ${#related_projects} -->
<tr>
<td>${project_name}</td>
<td>${assignee}</td>
</tr>
<!-- ${#line_items} -->
<tr>
<td colspan="2" style="padding-left:2em">${item_name} (x${qty})</td>
</tr>
<!-- ${/line_items} -->
<!-- ${/related_projects} -->
Generating Documents
Using a Button Trigger
- Open the record detail screen
- Click the configured button (e.g., "Create Invoice")
- Document generation runs (may take a few seconds to complete)
- When done, 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
- When Auto Execute is OFF: A confirmation dialog appears. Click "OK" to generate or "Cancel" to skip
- When done, the file is saved to the specified attachment field
Bulk Generation from the Record List
When Enable bulk output on list view is turned ON in a Button trigger configuration, a bulk output button appears on the record list screen.
Steps:
- Apply filter conditions on the record list screen (optional)
- Click the bulk output button
- A confirmation dialog shows the number of matching records — click "OK" to proceed
- Progress is displayed as an overlay (
Bulk generating: X / Y) - A toast notification shows the final success/failure count when complete
Notes:
- If no filter is applied, all records in the app are processed
- The maximum number of records that can be processed at once is 10,000 (kintone REST API limit)
- Do not navigate away from the page during processing
- If generation fails for some records, processing continues for the remaining records
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 have a 256 KB limit. Check the size meter at the top of the settings screen when using PDF HTML templates. Saving is blocked when the limit is exceeded.
PDF Japanese Fonts
html2pdf.js uses the browser's current fonts. Japanese text generally renders correctly, but some print environments may require embedded fonts.
Display Language
The settings screen automatically displays in Japanese or English based on the logged-in user's language setting (kintone.getLoginUser().language).
File Size
Generating documents from large DOCX/XLSX templates or records with many subtable rows may take longer. Keep templates as simple as possible to ensure generation completes before browser timeouts.
Troubleshooting
Document is not generated
Check:
- Plugin settings have been saved (did you click Save on the settings screen?)
- App ID, Record ID, Field Code, and Filename for the template storage app are correct
- Field code of the output attachment field is correct
- For another-app output: is the query syntax correct? (If the query is empty or no records match, a new record is created automatically)
Field value is not output (tag appears as-is)
Check:
- The field code exactly matches (watch for case sensitivity and spaces)
- Field codes can be verified in the kintone form settings
Tags are not replaced in DOCX / XLSX output
Check:
- There is no space between
$and{($ {field_code}is invalid) - Word/Excel auto-correct has not modified
${(try typing$and{separately) - There are no full-width spaces inside the tag
Excel output is blank
Check:
- Loop marker rows (
${#...}/${/...}) are correctly paired - The field code in the markers matches the actual subtable field code
PDF layout is broken
Check:
- Page size and orientation settings are appropriate
- Use
page-break-*CSS properties in the HTML template to control page breaks - Complex CSS layouts (flexbox, grid) may not render correctly in PDF output — table-based layout is recommended
Date is not formatted as expected
Check:
- The format string in the
formatoption is correct (see Day.js format tokens) - The field value is a valid date format — if you are storing dates in a plain text field rather than a kintone date field, the value must be in ISO format (
YYYY-MM-DD) for formatting to work
