> For the complete documentation index, see [llms.txt](https://support.docstudio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.docstudio.com/admin-panel/conversion-rules/wdextensions-overview.md).

# WDExtensions Overview

### Add the namespace

Add the namespace to your XSLT stylesheet.

```xml
<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:wdExtensions="java:com.whitedoc.xslt.extensions.WdExtensions"
                exclude-result-prefixes="wdExtensions">
    ...
</xsl:stylesheet>
```

### Available methods

#### getValueFromDictionary

`wdExtensions:getValueFromDictionary(String dictionaryUuid, String columnByUuid, String valueToFind, String columnToFind)`

Finds a record by a value in one column.

Returns the value from another column.

#### getRecordUuidByValueFromDictionary

`wdExtensions:getRecordUuidByValueFromDictionary(String dictionaryUuid, String columnUuid, String valueToFind)`

Finds a record by a column value.

Returns the dictionary record UUID.

#### createAttachementWithSourceFile

`wdExtensions:createAttachementWithSourceFile()`

Uploads the original source file to storage.

Returns the created attachment UUID.

Each call creates a new attachment UUID.

#### getMailboxUuidByAlias

`wdExtensions:getMailboxUuidByAlias(String mailboxAlias)`

Returns a mailbox UUID by its alias.

`mailboxAlias` can also be an XPath to a value in the source document.

#### findEnvelopeUuidByField

`wdExtensions:findEnvelopeUuidByField(String templateUuid, String fieldName, String fieldValue)`

Searches envelopes by an exact template field value.

Returns the envelope UUID only if exactly one envelope is found.

#### chainEnvelope

`wdExtensions:chainEnvelope(String envelopeUuid)`

Returns an existing `chainUuid`.

Or creates a new chain for the envelope.

Can return `null` if the envelope is already chained in another mailbox.

Use it for the `chainUuid` attribute in the generated envelope.
