---
source: https://carbone.io/documentation/design/advanced-features/forms.html
title: "How to include dynamic forms fields in your document?"
description: "How to include dynamic forms fields in your document?"
generated_at: "2026-07-10"
---

# Forms

How to include dynamic forms fields in your document?  
ENTERPRISE FEATURE Available for:  
✓ Carbone Cloud  
✓ Carbone On-premise  
✗ Embedded Carbone JS   v3.3+ 

## Dynamic Text fields

Editable text fields are used to collect user-provided information. Carbone can prefill these fields.

**Important Notes:**

-   The template must be an ODT file edited with LibreOffice.
-   Editable text fields are only supported in ODT and PDF documents.
-   Other file formats (e.g., XLSX, DOCX, ODS) do not support editable text fields, nor do ODT files created with MS Word.

### Example in LibreOffice

1.  In the top menu, click on `Form` > `Text Box`.
2.  Draw the text box on the document body.
3.  In the form toolbar, disable "Design Mode".
4.  Insert a Carbone tag inside the text box, e.g., `{d.value}`.
5.  Generate the document as a PDF or ODT with Carbone, and you're done!

![Dynamic input example](/img/doc/preview-form.png)

## Dynamic Checkboxes

Editable checkboxes allow users to choose between two distinct values, making them useful in complex forms and checklists. Here are several solutions:

-   [Solution 1](#dynamic-checkboxes-example-1-clickable-checkbox-in-odts): Clickable checkboxes can be created in PDFs and ODT reports. The template must be an **ODT file edited with LibreOffice**. Input elements in other formats (XLSX, DOCX, ODS, etc.) will not be clickable, even if the ODT file is created with MS Word.
-   [Solution 2](#dynamic-checkboxes-example-2-checkbox-in-any-document): Use Unicode characters or emojis to represent checkboxes.
-   [Solution 3](#dynamic-checkboxes-example-3-custom-checkboxes-from-images): Create custom checkboxes using SVG images.

### Example 1: Clickable Checkbox in ODTs

1.  In the top menu, click on "Form" > "Check Box".
2.  Insert the check box into the ODT template.
3.  Right-click on the check box and select "Control Properties".
4.  Insert the Carbone tag in the "Name" property. The checkbox will be ticked (checked) when the value is a Boolean with the value "true," a non-empty string, a non-empty array, or a non-empty object.

**Note**: It is not possible to create a list of checkboxes; otherwise, an error will be returned.

![Dynamic checkbox PDF ODT DOCX](/img/doc/dynamic-checkbox.png)

Get inspired by one of our real-life examples: [PDF Form](/examples/pdf-form/index.md) or [PDF Form with background image](/examples/pdf-forms-bg/index.md)

### Example 2: Checkbox in Any Document

Using the following expression, if the value is true, it will display `✅`; otherwise, it will display `⬜️`. Emojis can be replaced with Unicode characters.

```javascript
  {d.value:ifEQ(true):show(✅):elseShow(⬜️)} // Emojies
  {d.value:ifEQ(true):show(☑):elseShow(☐)} // Unicode Characters 1
  {d.value:ifEQ(true):show(☒):elseShow(☐)} // Unicode Characters 2
```

Get inspired by one of our real-life examples: [Vehicle Inspection Report](/examples/check-out/index.md)

### Example 3: Custom checkboxes from images

This example uses [dynamic images](pictures.md) to print custom checkboxes dynamically from SVG. The following JSON dataset is used:

**Data**

```json
{
  "value": false,
  "img1": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGc+PHJlY3Qgc3Ryb2tlPSIjMDAwIiBpZD0ic3ZnXzEiIGhlaWdodD0iMzAiIHdpZHRoPSIzMCIgeT0iMCIgeD0iMCIgZmlsbD0iIzA4ODc0RCIvPjwvZz48L3N2Zz4=",
  "img2": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGc+PHJlY3Qgc3Ryb2tlPSIjMDAwIiBpZD0ic3ZnXzEiIGhlaWdodD0iMzAiIHdpZHRoPSIzMCIgeT0iMCIgeD0iMCIgZmlsbD0iI0ZGRkZGRiIvPjwvZz48L3N2Zz4="
}
```

SVG images `img2` and `img1` are formatted as Data-URLs:

1.  Encode the SVG image as base64.
2.  Add the prefix `data:image/svg+xml;base64,` before the base64 string.

**Template**

In the template, insert a square placeholder image. Then, select the image and `right-click` > `Properties` > `Alternative Text` and write the following expression to display a colored checkbox: `{d.value:ifEQ(true):show(.img1):elseShow(.img2)}`.

_Expression Details:_

-   `d.value`: The checkbox value.
-   `:ifEQ(true)`: Conditional formatter that checks if the value is equal to `true`.
-   `:show(.img1)`: If the condition is true, the `.img1` SVG image is displayed.
-   `:elseShow(.img2)`: If the condition is false, the `.img2` SVG image is displayed.

![Dynamic checkbox PDF ODT DOCX](/img/doc/dynamic-checkbox-as-svg.png)

## Related topics

- [Translations i18n](/documentation/design/advanced-features/translations-i18n.md)
- [Transform](/documentation/design/advanced-features/transform.md)
- [Digital signatures](/documentation/design/advanced-features/signatures.md)
- [Pictures](/documentation/design/advanced-features/pictures.md)
- [Pagination](/documentation/design/advanced-features/pagination.md)
- [Key-value mapping](/documentation/design/advanced-features/key-value-mapping.md)
