> For the complete documentation index, see [llms.txt](https://developers.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.docstudio.com/api-documentation/template-api/template-dynamic-fields-api/duplicate-field-api.md).

# Duplicate Field API

Use this page to add a duplicate field to template XML. A duplicate field is read-only and shows the value from another field.

### Duplicate field example

```xml
<duplicate
    name="customer_name_copy"
    documentId="document-id"
    relatedTo="customer_name"
    search="true"
/>
```

### Required attributes

* `name` — field name. Use 1 to 128 characters. Do not use `&`, `"`, `<`, or `>`. Keep the value unique within one document.
* `documentId` — document ID where the related field is located.
* `relatedTo` — name of the related field.

### Optional attributes

* `search` — set to `true` if the field value should be available in envelope search. If you omit it, the default value is `false`.

### Related topics

* [Template Dynamic Fields API](/api-documentation/template-api/template-dynamic-fields-api.md)
* [Template Structure API](/api-documentation/template-api/template-structure-api.md)
* [Send Envelope](/api-documentation/envelope/send-envelope.md)
* [Fill Envelope](/api-documentation/envelope/fill-envelope.md)
