# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.docstudio.com/admin-panel/conversion-rules/wdextensions-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
