Generate a Document with Date and Name Modifiers
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.
Modifiers in document templates are formatting rules that control how field values, such as dates or full names, are displayed.
Input data can be pre-formatted in the application or passed through REST.
When to Use
- You need to format a date using the document generator.
- You need to display a full name in a specified format.
What to Include in the Request
Date and name modifiers are applied to the values of the template placeholders through the values and fields parameters of the documentgenerator.document.add method.
User Documentation
For Date
-
In
values, pass the date in Atom format, for example,2026-03-18T00:00:00+03:00. -
In
fields, specify the field type:TYPE=DATE. -
If necessary, set the default output format via
FORMAT['format']:d— day of the month with leading zeroj— day of the month without leading zerom— month number with leading zeron— month number without leading zeroF— full month namey— year in two digitsY— year in four digitsH— hours in 24-hour format with leading zeroi— minutes with leading zeros— seconds with leading zero
Date and time formatting symbols can be combined:
d.m.y—28.03.26j F, Y—28 March, 2026H:i:s—10:24:18Y-m-d H:i:s—2026-03-28 10:24:18
For Name
-
In
values, pass the name as an array with parts of the full name:[ 'NAME' => 'Igor', // first name 'LAST_NAME' => 'Ivanov', // last name 'SECOND_NAME' => 'Petrovich', // patronymic 'GENDER' => 'M', // gender ]
The GENDER key can explicitly specify the gender: M or F. If the gender is not specified, the module will attempt to determine it based on the patronymic. If both GENDER and the patronymic are not provided, the gender will not be determined, and declension will not work.
-
In
fields, specify the field type:TYPE=NAME. -
In
FORMAT['format'], you can pass the output template:#TITLE#— salutation#NAME#— first name#LAST_NAME#— last name#SECOND_NAME#— patronymic#NAME_SHORT#— first letter of the first name with a dot#LAST_NAME_SHORT#— first letter of the last name with a dot#SECOND_NAME_SHORT#— first letter of the patronymic with a dot
Example
$data = [
'templateId' => 203,
'providerClassName' => 'Bitrix\\DocumentGenerator\\DataProvider\\Rest',
'value' => 'ORDER_1024',
'values' => [
'SomeDate' => '2026-03-18T00:00:00+03:00', // value passed in atom format
'SomeName' => [ // name passed as an array
'NAME' => 'Vladislav',
'LAST_NAME' => 'Gorelkin',
'GENDER' => 'M',
],
],
'fields' => [
'SomeDate' => [
'TYPE' => 'DATE',
'FORMAT' => [
'format' => 'd f Y H:i', // output format
],
], // field type - date
'SomeName' => [
'TYPE' => 'NAME',
'FORMAT' => [ // here you can pass the default field format
'format' => '#NAME# #LAST_NAME#' // output format
]
], // field type - name
]
];
$url = $webHookUrl.'documentgenerator.document.add/';
Continue Learning
- Generate a Document with Text
- Generate a Document with Tabular Data
- Generate a Document with Complex Tables
- Generate a Document with Images and Stamps
- Typical use-cases and scenarios of the document generator: case overview