Version 2 (advanced)
.docx templates on version 2: step-based form, repeatable rows, paragraphs per COR occupation, and conditional blocks.
This guide describes the .docx Templates module for templates created on version 2.
A template consists of two parts: the Word file in which you write the markers (variables and blocks), and the form you build in the interface, step by step. At generation time, the form answers are placed into the document: simple variables are replaced with text, lists multiply into several rows, and conditional paragraphs appear or disappear.
Important A template's version is chosen once, at creation, and cannot be changed afterwards — the version selector disappears from the settings screen once the template has been saved.
1. How it works
- Create the template and fill in the basic settings.
- Upload the
.docxfile. The file is not scanned — the application does not look for variables in it. - Build the form: add steps, and add questions within each step. For each question, set the variable name (the Variable field).
- Write the corresponding markers in the Word document — exactly the names you gave in step 3, using the syntax in section 6.
- The employee fills in the form (or the document is generated automatically from platform data).
- The markers are replaced, group rows multiply, and conditional blocks appear or disappear. The result is the final document, sent for signing.
The key consequence: the link between form and document is the variable name, written identically in both places. There is no auto-detection and no validation — if the name does not match, the marker stays empty or the generation fails.
The order does not matter: you can upload the file before or after building the form.
2. The template list
The main page displays all the .docx templates in the organisation, with the columns Title, File, Form (the number of configured steps), and Signers.
From each row's action menu (the three-dot icon):
| Action | What it does |
|---|---|
| Form | the step and question builder |
| Signers | who signs and where the signature is placed |
| File | uploading the .docx/.pdf file; if the template uses multiple files, it opens the list of files per COR occupation |
| Generate | the generation screen for employees |
| Settings | title, validity, series, file model, completion mode, automatic approval |
| History | the answers filled in on the form, with Excel export |
| Delete | deleting the template |
3. Creating a template
Press the add button and fill in:
| Field | Description |
|---|---|
| Document title | the document name; it must be unique — otherwise the error "Titlul este deja folosit" (the title is already in use) appears |
| Validity (number of days from completion) | after how many days the generated document expires. Leave 0 for unlimited. |
| DOCX form version | choose Version 2 (recommended) — this is the default value. The option only appears at creation. |
| Series index | the starting value of the document series, e.g. AB00001. The document marker is {{SERIE}}. Leave empty if you are not using a series. |
| File model | A single file model for all employees or A different file for each COR occupation |
| Completion mode for employees | Form filled in by employees or Automatic generation from existing platform data |
| automatically approved after signing | the document approves itself as soon as it has been signed by all signers |
All of these settings can be changed later from the template menu → Settings, except the version.
4. Uploading the .docx file
From the template menu → File. Both .docx and .pdf files are accepted.
- A PDF file is a fixed document, with no variables and no form. For a PDF template without multiple files, the Form option in the menu is disabled.
- The
.docxfile is not analysed on upload — you get no confirmation that the markers inside it are correct. The first real check happens when a document is generated. - Re-uploading the file has no effect whatsoever on the form you have already configured.
Recommendation: after every change to the file or the form, generate a test document for an employee and check the result.
5. Different files for each COR occupation
If in Settings you chose "A different file for each COR occupation", the File option in the menu opens a list of all COR occupations, where you upload a separate .docx file for each.
- At generation time, the application picks the file matching the employee's COR occupation.
- All files use the same form and the same variable names. A file may use only some of the variables — missing markers do not cause errors.
- If no file has been uploaded for the employee's COR occupation, generation fails with the missing-file error.
- The
{{SERIE}}series is shared across all files — the counter is unique per template, not per COR occupation.
6. Complete marker reference for the Word document
This is the central section of the guide. Markers are written directly in the Word document, as ordinary text.
6.1 Reference table
| Marker type | Syntax | Used for |
|---|---|---|
| Simple variable | {{VARIABILA}} | Text, Number, Date, Select, Radio, Checkbox questions |
| Document series | {{SERIE}} | the record number, incremented automatically |
| Repeatable block (open / close) | {{#VARIABILA}} … {{/VARIABILA}} | Group and Paragraphs questions |
| Current row number | {{INDEX}} — only inside a block | automatic numbering 1, 2, 3… |
| Current paragraph text | {{TEXT}} — only inside a Paragraphs block | the paragraph content |
| Variable from inside the group | {{VARIABILA_COPIL}} — only inside the group's block | the answers to the questions in the group |
| Conditional block | {{#VARIABILA_CONDITIE}} … {{/VARIABILA_CONDITIE}} | text that appears only if a condition is met |
6.2 Writing rules
-
The delimiters are exactly
{{and}}— two braces, with no spaces inside.{{NUME}}is correct;{ NUME },{{ NUME }}or{{NUME }}are not. -
Every block that is opened must be closed.
{{#ECHIPAMENTE}}must always have a matching{{/ECHIPAMENTE}}, with exactly the same name. The application's interface only shows you the opening marker, so the closing one is easy to forget — this is the number one cause of the file processing error. -
The name must be identical in the form and in the document. Recommendation: UPPERCASE, with
_instead of spaces, no diacritics and no braces — e.g.DATA_ANGAJARII,NR_ORE. The application does not validate variable names, so a mistake is not flagged on save, only when the document is generated. -
Blocks can be nested — for example a condition wrapping a group:
{{#ARE_ECHIPAMENT}} List of equipment received: {{#ECHIPAMENTE}}{{INDEX}}. {{DENUMIRE}} — {{CANTITATE}} pcs. {{/ECHIPAMENTE}} {{/ARE_ECHIPAMENT}} -
An empty block produces nothing. If the group has no rows or the condition is not met, all the text between the markers disappears from the final document. This is the mechanism for optional text.
-
Word can "break" a marker. If you edit a marker partially, let autocorrect change it, or format only part of it (bold on half the tag, for instance), Word splits it internally into fragments and the engine no longer recognises it. If a correctly written marker does not work, delete it completely and retype it in one go, with uniform formatting. Pasting as plain text ("Keep Text Only") helps.
-
The same simple variable can appear several times in the document; every occurrence is filled in the same way.
6.3 Repeatable table rows
To multiply a table row, the opening and closing markers must be on the same row:
{{#VARIABILA}}in the first cell of the row;{{/VARIABILA}}in the last cell of the same row;- the child variables in the cells between them.
| No. | Name | Quantity | |
|---|---|---|---|
{{#ECHIPAMENTE}}{{INDEX}} | {{DENUMIRE}} | {{CANTITATE}} | {{/ECHIPAMENTE}} |
At generation time, the row is multiplied once for every row filled in on the form. The table header row is left untouched.
If you put
{{#ECHIPAMENTE}}on one row and{{/ECHIPAMENTE}}on a different row, the entire range of rows between them repeats — occasionally useful, but rarely what you want.
7. Form steps
From the template menu → Form.
The form is split into steps (sections). The employee fills it in step by step, and validation happens at each step.
- Add Step creates a new step, named "Step N" by default.
- Steps can be renamed, reordered, and deleted from each step's menu.
- The order of steps matters: a condition can refer only to a question in an earlier step, or higher up in the same step.
A template with no steps has no form and cannot generate anything; in the template list it is flagged as having an empty form.
8. Form questions (fields)
Within each step, the Add question button creates a new question. Click it to configure it.
8.1 General properties
| Field | Description |
|---|---|
| Label | the question text, shown to the employee |
| Help text | an explanation shown under the question |
| Answer type | see table 8.2 |
| Required | the answer is needed in order to move to the next step |
| Variable | the variable name written in the document. The interface displays the correct delimiters around it: {{...}} for simple fields and {{#...}} for Group and Paragraphs. |
| Answer options | for Select / Checkbox / Radio — one option per line |
| Allow another option | Select only — allows a free-text answer outside the list (max. 100 characters) |
| Number of days in advance | Date only — pre-fills with today's date + the number of days |
| Pre-filled from the platform with | Text and Number only — see section 9 |
| Cannot be edited | pre-filled fields only — the field is locked |
| Allow adding several rows | Group only |
| Conditioned by the platform field | Paragraphs only — currently the only option is COR occupation |
8.2 Answer types and their markers
| Type (interface label) | What the employee fills in | Marker in the document |
|---|---|---|
| Text | free text (max. 500 characters) | {{VARIABILA}} |
| Number | a numeric value (max. 500 characters) | {{VARIABILA}} |
| Date | a date from the calendar | {{VARIABILA}} — written in dd.mm.yyyy format |
| Select | one option from the list (optionally "another option") | {{VARIABILA}} |
| Checkbox | several ticked options | {{VARIABILA}} — see the note below |
| Radio | one option from the list | {{VARIABILA}} |
| Group | one or more rows, each with its own questions | {{#VARIABILA}} … {{/VARIABILA}} |
| Paragraphs | nothing — the paragraphs are chosen automatically by COR occupation | {{#VARIABILA}}{{INDEX}}. {{TEXT}}{{/VARIABILA}} |
A note about Checkbox. A Checkbox field sends the list of ticked options to the document, not a single piece of text. Check the result on a test document before using it in production: if you need precise formatting of the list (each option on its own line, bulleted, numbered), use a Group field with a single question instead, which gives you full control through the
{{#VARIABILA}} … {{/VARIABILA}}block.
8.3 Automatic rules
- A Group field cannot be required — the checkbox is disabled automatically.
- A Paragraphs field is always read-only — the employee cannot change it.
- Inside a Group you cannot add further Group or Paragraphs fields (a single level of nesting).
- Pre-filling from the platform is available only for the Text and Number types.
9. Pre-filling from platform data
For Text and Number questions, the "Pre-filled from the platform with" option fills the answer in automatically from the employee's record:
| Interface option | Filled in with |
|---|---|
--- none --- | nothing; the employee fills it in manually |
| Employee surname | the surname |
| Employee first name | the first name |
| Employee full name | the full name |
| Employee email | the email address |
| Employee ID number | the ID number |
| Workplace supervisor name | the workplace supervisor; if missing, the company administrator |
| Second supervisor name | the second supervisor; if missing, the company administrator |
| Employee department | the department |
| Employee physical location | the physical location |
| Employee position | the position |
| Employee COR occupation | the COR occupation |
| Employee authorisations | the authorisations |
| Employee qualification | the qualification |
| Employee address | the address |
| Employee town | the town |
| Employee county | the county |
| Employee CNP | the personal numeric code |
| ID card series | the ID card series |
| ID card number | the ID card number |
| ID card issued by | the issuing institution |
| ID card issue date | the issue date |
| ID card expiry date | the expiry date |
If you also tick "Cannot be edited", the field appears locked in the form, and the value is re-read from the employee's record on every save — the employee cannot change it, directly or indirectly.
There are no "magic" variable names. A
{{NUME}}marker means nothing by itself: you must create a question with the variableNUMEand set its pre-fill to Employee full name. The only markers that work without a corresponding question are{{SERIE}},{{INDEX}}, and{{TEXT}}. This is a major difference from version 1, where predefined variables were filled in by name alone.Data that does not appear in the table above — the employee's education or the document author's name, for instance — has no automatic source and must be filled in manually, as Text questions.
10. Group fields — repeatable rows
A Group is a question that contains other questions and can be filled in several times. It is used for lists: equipment handed over, family members, completed courses, line items in a table.
Configuration:
- Add a Group question, with the label and variable you want (e.g. the variable
ECHIPAMENTE). - Tick "Allow adding several rows" if the employee needs to be able to add rows. Without this, the group has a single row.
- Add the questions inside the group (the children), each with its own variable — e.g.
DENUMIRE,CANTITATE.
In the document:
{{#ECHIPAMENTE}}{{INDEX}}. {{DENUMIRE}} — {{CANTITATE}} pcs.
{{/ECHIPAMENTE}}or, as a repeatable table row (see 6.3):
| No. | Name | Quantity | |
|---|---|---|---|
{{#ECHIPAMENTE}}{{INDEX}} | {{DENUMIRE}} | {{CANTITATE}} | {{/ECHIPAMENTE}} |
Notes:
{{INDEX}}is the row number, starting from 1. It is optional — use it only if you want numbering.- Child variables are written without
#, as simple variables, but they are valid only inside the block. - If the group has no rows filled in, the whole block disappears from the document.
11. Paragraphs fields
A Paragraphs field is a list of texts you predefine, each assigned to a list of COR occupations. When the document is generated, only the paragraphs matching the employee's COR occupation are included automatically.
It is used for documents whose content differs by trade: training, position-specific duties, job risks.
Configuration:
- Add a Paragraphs question, with the variable you want (e.g.
ATRIBUTII). - Under "Conditioned by the platform field", choose COR occupation (currently the only option).
- Save, then open the field's paragraph list and use Add paragraph: fill in the Paragraph text and select the COR occupations it applies to.
- Paragraphs can be reordered — the order in the list is the order in the document.
In the document:
{{#ATRIBUTII}}{{INDEX}}. {{TEXT}}
{{/ATRIBUTII}}{{TEXT}}is the paragraph content. It is mandatory inside the block — without it, nothing is displayed.{{INDEX}}is the paragraph number, from 1. Optional.- The field is always read-only; the employee sees it filled in but cannot change it.
- If the employee has no COR occupation assigned, or no occupation matches, the block stays empty.
12. Display conditions and conditional blocks
A condition does two things at once:
- in the form — it hides or shows the question, depending on an earlier answer;
- in the document — it provides a yes/no variable that you use as a conditional block.
12.1 Adding a condition
From the question's menu → add condition. Fill in:
| Field | Description |
|---|---|
| The question | the question the display depends on. You can choose only earlier questions (from a previous step, or higher up in the same step). |
| is | the comparison operator — see table 12.2 |
| the value / one value per line | the comparison value (or values), depending on the operator |
| Variable | the condition's variable name, used in the document as {{#VARIABILA}} … {{/VARIABILA}} |
12.2 Available operators
The operators offered depend on the type of the referenced question:
| Operator in the interface | Applies to |
|---|---|
| not filled in / filled in | any question type |
| equal / different | Text, Select, Radio, Date, Number |
| greater than / less than | Date, Number |
| includes one of the values / does not include the values | Checkbox |
| included in / not included in | Text, Select, Radio, Number |
For equal, different, greater than, and less than a single value is entered. For includes / does not include / included in / not included in, several values are entered, one per line.
Notes:
- Text comparison is case-insensitive:
DAanddaare treated as equal. - For greater than / less than, values are compared numerically; if the answer is not a valid number, the condition is treated as not met.
- If the referenced answer is empty, all conditions other than not filled in / filled in are treated as not met.
- Only the first condition on a question is evaluated. In practice, a question has a single active condition — do not combine several conditions on the same field expecting an "and" / "or".
12.3 Using the condition in the document
The condition's variable has the value yes when the condition is met and no when it is not. In the document it is used as a block:
{{#ARE_AUTORIZATIE}}
The employee holds authorisation no. {{NR_AUTORIZATIE}}, valid until {{DATA_EXPIRARE}}.
{{/ARE_AUTORIZATIE}}The block appears in full if the condition is met and disappears completely if it is not.
12.4 The "otherwise" case
There is no inverted block. To display alternative text, create a second condition, negated, with its own variable:
| Condition | Operator | Variable |
|---|---|---|
| 1 | filled in | ARE_AUTORIZATIE |
| 2 | not filled in | FARA_AUTORIZATIE |
{{#ARE_AUTORIZATIE}}The employee holds authorisation no. {{NR_AUTORIZATIE}}.{{/ARE_AUTORIZATIE}}
{{#FARA_AUTORIZATIE}}The employee holds no authorisation.{{/FARA_AUTORIZATIE}}12.5 What happens to the answer of a hidden question
When a condition hides a question, its answer is cleared automatically. In the document, the hidden question's variable is left without a value, and the condition's variable becomes no. This is why it is usually cleaner to wrap the entire paragraph in the condition's block than to leave isolated variables that would render empty.
13. Automatic document series
If you fill in Series index in Settings (e.g. AB00001), the {{SERIE}} variable is available in every document generated from this template.
- The counter increments automatically with each generated document:
AB00001→AB00002→ … - The format is free:
AB00001,00001,1— incrementing preserves the structure and the length. {{SERIE}}is not declared as a form question; it works only from the template setting.- The counter is unique per template, even when you use different files per COR occupation.
- If Series index is empty,
{{SERIE}}stays unfilled in the document.
14. Completion mode: form or automatic generation
The "Completion mode for employees" setting has two values:
Form filled in by employees (default)
The employee receives a completion request, goes through the form steps, checks the summary, and submits. The document is generated from their answers.
Automatic generation from existing platform data
The form is not shown to the employee. The document is generated directly, using:
- Text and Number fields that have platform pre-filling;
- Date fields (today's date + days in advance);
- Paragraphs fields (filtered by COR occupation).
Rules in this mode:
- an optional field with no value is written into the document as
-; - a required field with no value stops the generation, with the message: "Lipseste valoarea pentru campul obligatoriu: NUME_VARIABILA" (the value for the required field is missing);
- Select, Checkbox, Radio, and Group fields are ignored — they have no automatic data source. Do not use them in templates with automatic generation.
15. Signers
From the template menu → Signers. Add the signers in the order in which they must sign.
Signer types
| Type | Who signs |
|---|---|
| Employee | the employee the document was generated for |
| Supervisor N+1 | the employee's direct supervisor; if missing, the administrator |
| Supervisor N+2 | the second level of management; if missing, the administrator |
| Document author | the user who initiated the generation |
| Administrator | the organisation's administrator |
| Specific contact | a particular person, chosen from a list |
Signature boxes are placed automatically in the generated document, in the order in which you added the signers. Their position is not configurable from the interface.
16. Answer history and Excel export
From the template menu → History.
The table shows, for each generated document: the document, the employee, and the completion date.
Excel export: select a date range (start date and end date) — the Export button is enabled only once both are filled in. The file contains one column per form question; for questions inside groups, the column is named Group label: Question label, and the values from the group's rows are concatenated and separated by ; .
The export is limited to 500 rows. If the selected range contains more records, narrow the period.
Deleting a record from the history deletes only the answers — the generated document remains on the employee's file.
17. A complete end-to-end example
Goal: a protective equipment handover form, with a record series, an equipment table with a variable number of rows, position-specific duties per COR occupation, and a paragraph that appears only if the employee works at height.
Step 1 — Template settings
- Document title:
Fisa predare EIP - Validity:
365 - Version:
Version 2 (recommended) - Series index:
EIP00001 - File model: a single model
- Completion mode: form filled in by employees
Step 2 — The form
Step 1 — "Employee data"
| Label | Type | Variable | Configuration |
|---|---|---|---|
| Full name | Text | NUME | Pre-filled: Employee full name; Cannot be edited |
| COR occupation | Text | FUNCTIE | Pre-filled: Employee COR occupation; Cannot be edited |
| Handover date | Date | DATA_PREDARII | Number of days in advance: 0 |
Step 2 — "Equipment"
| Label | Type | Variable | Configuration |
|---|---|---|---|
| Equipment handed over | Group | ECHIPAMENTE | Allow adding several rows |
| ↳ Name | Text | DENUMIRE | Required |
| ↳ Quantity | Number | CANTITATE | Required |
Step 3 — "Specific risks"
| Label | Type | Variable | Configuration |
|---|---|---|---|
| Works at height? | Radio | LA_INALTIME | Options: Da, Nu |
| Position-specific duties | Paragraphs | ATRIBUTII | Conditioned by: COR occupation; paragraphs added per occupation |
On the Position-specific duties question, add a condition:
- The question:
Works at height? - is:
equal - the value:
Da - Variable:
LUCRU_INALTIME
Step 3 — The Word document
PERSONAL PROTECTIVE EQUIPMENT HANDOVER FORM
No. {{SERIE}} of {{DATA_PREDARII}}
Employee: {{NUME}}
Occupation: {{FUNCTIE}}
Equipment handed over:| No. | Name | Qty. | |
|---|---|---|---|
{{#ECHIPAMENTE}}{{INDEX}} | {{DENUMIRE}} | {{CANTITATE}} | {{/ECHIPAMENTE}} |
Position-specific duties:
{{#ATRIBUTII}}{{INDEX}}. {{TEXT}}
{{/ATRIBUTII}}
{{#LUCRU_INALTIME}}
Note: the activity involves work at height. The employee has been trained
on the use of the fall arrest system.
{{/LUCRU_INALTIME}}
Signatures:The result
For an employee who fills in 3 pieces of equipment, has 2 duties for their occupation, and answers Da to work at height:
{{SERIE}}becomesEIP00042(the counter's current value);- the table row multiplies into 3 rows, numbered 1, 2, 3;
- the
ATRIBUTIIblock produces 2 numbered paragraphs; - the note about work at height appears.
For an employee who answers Nu, the note disappears completely, along with the markers.
18. Errors and troubleshooting
18.1 Errors at document generation
| Message | Cause | Solution |
|---|---|---|
| "Fisierul DOCX este incorect, verificati daca variabilele sunt scrise corect" (the DOCX file is incorrect, check that the variables are spelled correctly) | the file could not be interpreted: a {{#…}} block has no matching {{/…}}, the opening and closing names differ, a marker was broken by Word, or the delimiters are wrong | The message does not say which marker is wrong. Check in turn: (1) every opened block has a closing one with exactly the same name; (2) no marker has spaces inside; (3) retype the suspect markers in one go, with uniform formatting. |
| "Fisierul docx nu exista" / "Template docx lipsa" (the docx file does not exist / the docx template is missing) | no file has been uploaded to the template, or — in multiple-file mode — there is no file for the employee's COR occupation | upload the missing file from the File menu |
| "Lipseste valoarea pentru campul obligatoriu: X" (the value for required field X is missing) | Automatic generation mode, and the required field X has no value in the platform | fill the data in on the employee's record, or make the field optional (- will appear in the document) |
| "FormResult invalid" | the form answers were not found for this employee | the employee has to fill the form in again |
| "Revizie invalida" (invalid revision) | the document is no longer in draft state | restart the generation from a new revision |
| "Eroare la procesarea fisierului" (error processing the file) | a general error in the generation engine | retry; if it persists, open the file in Word, save it again, and re-upload it |
18.2 A marker that does not get filled in
If a marker stays as text ({{NUME}} appears literally in the final document) or stays empty:
- the name in the document does not match the Variable field in the form — check it letter by letter, including capitalisation;
- the question has no Variable value filled in;
- the question was hidden by a condition, so the answer was cleared;
- the marker is written inside the wrong block — a group's child variable works only between
{{#GRUP}}and{{/GRUP}}; - the marker was broken by Word — retype it.
18.3 Form validation messages
When the employee fills the form in, the general message is "Formularul are erori, te rugam sa verifici" (the form has errors, please check). The following codes can appear on fields, currently untranslated:
| Code shown | Meaning |
|---|---|
required | a required field was left empty (or "another option" was left unspecified) |
max_length_500 | text or number longer than 500 characters |
max_length_100 | the value in "another option" exceeds 100 characters |
invalid_date | the entered date is not valid |
invalid_option | the submitted option is not part of the configured list |
invalid_options | one of the ticked options is not part of the list |
invalid_format | the answer format is not the expected one |
value_not_blank | a field hidden by a condition was submitted with a value |
The last four generally appear because of configuration problems (options changed after the form had already been filled in) and are resolved by re-filling the form once the configuration has been corrected.
19. Deleting a template
From the template menu → Delete.
The confirmation warns: "vei sterge acest tip de document si nu va mai exista in filtre si rapoarte! Operatia este ireversibila." (you will delete this document type and it will no longer exist in filters and reports! The operation is irreversible.)
A template cannot be deleted if it already has generated documents. If it uses a file collection (different files per COR occupation), the message "Șterge mai întâi colecția de fișiere din Gestiunea fisierelor" (delete the file collection from File Management first) appears — delete the files first, then the template.