Link Search Menu Expand Document

EDI Definition Editor

To exchange EDI files with partners, an EDI Definition should be added first. EDI Definition is the entity created according to the partner’s EDI Specification that is used by EDI Generator to generate and validate EDIs. EDI Definition Editor can be used to create such definitions with the validation rules and conditions demanded by the partner. To create an EDI definition, navigate to EDI section in the side menu and then Txn Sets.

EDI Definitions List
EDI Definitions List

You can create a new EDI Definition with the Create button. You can also import an existing definition in the JSON format with the Import Definition button.

Create a Definition

Select the EDI version from the Version dropdown, then select the EDI document type from the Type dropdown. After selecting the version and document type you can either choose to import the generic EDI definition for the selected version and type from the X12 database with the Load EDI Definition from X12 Database button, or proceed to create the definition from scratch. Transaction Set Header (ST) and Transaction Set Trailer (SE) segments will be added by default.

Create EDI Definition
Create EDI Definition

Segments

To add a new segment you can select Add segment sibling option from the right hand side dropdown of an existing segment or a loop. You can also change the position of a segment inside the EDI definition using the up arrow and down arrow icons next to the dropdown. Any cell can be clicked to edit the content, and depending on the data type, the suitable edit action will be allowed.

Segment
Segment

After adding a segment you can load the segment details like elements in the segment, number of maximum uses and the required flag for the segment from the backend with the Load segment definition option from the menu.

Or else you can create the segment from scratch with the following steps.

  • From the required flag select if the segment should be Mandatory, Optional or Conditional.
  • If you want to override the optional condition of a segment and set it as a mandatory field, check the Must Use checkbox.
  • Add the number of maximum uses of the segment. If the segment can be used unlimited times you can use >1 as the number of maximum uses.

Loops

A loop is a collection of segments that can be repeated as a collective. To add a new loop, similar to a new segment, you can select Add loop sibling option from the dropdown of an existing segment or a loop. Similarly, you can use up and down arrows to move the loop position within the definition and the loop will go to editable mode once a cell is clicked on.

Loop
Loop

You can click on Add segment child option from the dropdown to add a child segment inside the loop. And use Add loop child option to add a nested loop within the loop.

Mandatory Expressions

Click icon to add any conditions where a segment or a loop should be mandatory. The condition should be added in the following syntax,

  <relative path to the segment/loop>[@<element position>="<value>"]

These conditions can also be concatenated with OR and AND operators.

E.g.:According to Walmart 810 specification PO4 segment is required when the IT103 contains a Unit of Measure of ‘CA’ (Cases) and is used to identify the number of selling units are in a case. This condition can be added to the PO4 segment definition as below.

  ./IT1[@03="CA"]

Syntax rules

Once you load the segment definition, any syntax rules related to the segment will be automatically added. Or you can click the Add Syntax Rule button on the Syntax Rules tab to manually add the syntax rule, with the use of EDI standard relational condition syntax. EDI Generator will generate the human-readable format of the added rule, if the added syntax were valid.

Syntax Rules
Syntax Rules

Elements

In the Elements section you can add the elements of the current segment and set the element position, element ID, description, required flag, data type, min/max values of the element. Click to set a fixed default value for the element. This default value will be automatically added to any EDI file created from the definition. Click to set a mandatory expression for the element. Refer to Mandatory Expressions section for more details.

There is a Hide button for each segment and element to hide them within the form. If you want to remove any segment or element, you can use the hide button and later use the Clean button on the top right hand corner to permanently remove all hidden elements from the form at once.

Alphanumeric Data Type

If the elements data type is alphanumeric, you can additionally set regular expressions to match the allowed values. Optionally you can add a condition on when that regular expressions should be in effect. Refer to Mandatory Expressions section for more details on how to add the conditional.

E.g.: The Walmart 810 EDI specification defines BIG02 element as below.

Walmart 810 BIG02
Walmart 810 BIG02

According to the specification, the required flag for BIG02 is Mandatory (M), the data type is alphanumeric (AN) and the min/max values are 1/22. Moreover, Walmart accepts only a maximum of 15 digits and, numeric values only. To ensure that below regular expression could also be added within the element definition.

Walmart 810 BIG02 Definition
Walmart 810 BIG02 Definition

ID Data Type

If the elements data type is ID, you have to provide the ID values which are allowed based on your partner’s use of them. Very often partners tend to use a subset of IDs specified by X12 standards for an element. In that case, add those IDs as a comma separated list, and use the Load only specified key(s) button to load the descriptions of those. In the rare case when the partner is using one or more custom ID values, which are not part of the X12 managed dataset, click the Add the specified key(s) as custom values button to add them with a description.

You can click Load all values button to load all the ID values for an element, but keep in mind that this is a heavy operation and could load hundreds of values. Click on the delete button to remove all the ID key values.

Additionally, for situations where an ID value must be present within at least one of the segment/loop occurrences, you can use At least one of groups option. This option also supports the Mandatory Expression to add a condition for when this should be applied.

E.g.:For Walmart 810 N1 segment N101 element, these conditions should be applied,

  • At least one instance of the Party Identification (N1) segment with Ship To (ST) qualifier is required by Walmart.
  • Walmart requires an instance of the N1 be sent with a N101 of ‘SU’

They can be added to the definition as below,

ID Elements Syntax
ID Elements Syntax

Once the EDI definition creation is finished, You can use the Create button to create and save the definition. You can also save the already created portion of the definition halfway through, by clicking on Save and keep editing option as a safety measure.

Show Hidden button can be used to show any hidden elements or segments while creating the definition. Clean button can be used to permanently remove all the hidden elements and segments permanently from the definition.

Top Level Actions
Top Level Actions