> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/administration-and-setup/settings/global-settings/document-types/edi/edi/setting-up-edi-templates.md).

# Setting Up EDI Templates

## Here are step-by-step instructions for setting up EDI templates:

<figure><img src="/files/EVnMiu5HTNxEc1z18Xz2" alt=""><figcaption></figcaption></figure>

**Define the structure descriptor:**

* Identify the type of EDI message you are working with, e.g. ANSI X12, EDIFACT, or a custom format.
* Determine the segments, elements, and subelements within the EDI structure.
* Create a structure descriptor that accurately reflects the hierarchy and organization of the EDI message. This can be done using a special syntax such as XML or JSON.

<figure><img src="/files/Wa1MA56jWaRKBLMKs3Mx" alt="" width="273"><figcaption></figcaption></figure>

**Set up transformations:**

* Use an appropriate tool or software that supports EDI transformations, such as an EDI translator.
* Define the rules for converting the EDI message to your system's internal format and vice versa.
* Configure the transformations to interpret and process segments, elements, and subelements according to your system's requirements. Test the transformations thoroughly to ensure that the data is correctly interpreted and formatted.

<figure><img src="/files/YFVjCRvyGjBIP3UuOhM9" alt="" width="268"><figcaption></figcaption></figure>

**Configure extraction paths for optimal data extraction and formatting:**

* Identify the data fields to be extracted and transferred to your internal system.
* Define extraction paths or rules to extract the relevant data fields from the EDI messages.
* Consider the different variations and formats that may occur in the incoming EDI messages and ensure that the extraction paths are flexible enough to accommodate them.
* Validate the extraction results to ensure that the correct data fields are extracted and correctly formatted.

<figure><img src="/files/3SHqpaLRmuz27wO6Bdek" alt="" width="92"><figcaption></figcaption></figure>

By carefully defining the structure descriptor, setting up transformations and configuring extraction paths, you can ensure that data extraction and formatting are performed optimally in your EDI templates. This will help improve the efficiency and accuracy of your electronic business communications.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.docbits.com/administration-and-setup/settings/global-settings/document-types/edi/edi/setting-up-edi-templates.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.
