Typical use-cases and scenarios of the document generator: case overview
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
A template in the document generator is a .docx file with placeholders for fields that are replaced with data from the request when creating the document. Placeholders are formatted in curly braces, such as {DocumentNumber} or {MyField}. For more details, refer to the article Document Generator Templates: Overview of Methods.
The cases help prepare data for document creation based on the template using the documentgenerator.document.add method. After creating the document, you can obtain links to the files and continue working with the results using methods from the Document Generator: Overview of Methods section.
Quick navigation: all cases
Getting Started
- Prepare a
.docxtemplate with field placeholders. - Retrieve the field map of the template using the documentgenerator.template.getfields method.
- Determine which data needs to be passed in
valuesandfieldsfor the documentgenerator.document.add method.values— what to insert into the document.fields— how to interpret this data: field type, format, image, print, table, or repeating block.
- Open the example that is closest to your scenario and adapt it to your template.
Case Overview
|
Case |
Description |
|
Inserts text values without additional field type settings |
|
|
Formats date and name through |
|
|
Fills rows of a single table with a repeating structure |
|
|
Works with nested tables and multiple repeating blocks |
|
|
Inserts images, seals, and signatures via external links |