---
title: EDIMessageTypeParseString System Parameter - EDIFACT Message Type Names
description: EDIMessageTypeParseString is the pattern the Nodinite Logging Service uses to build the Message Type name of EDIFACT messages from the UNH segment. The default produces names such as ORDERS.D 96A UN; only newly logged messages get a changed name.
---

# EDIMessageTypeParseString - System Parameter

The **EDIMessageTypeParseString** [System Parameter][System Parameters] is the pattern the [Logging Service][] uses to build the [Message Type][Message Types] name of an EDIFACT message from its **UNH** (message header) segment. The Message Type name decides which [Search Field Expressions][] apply to the message.

![Log View Contoso: EDIFACT invoices from suppliers with an invoice named INVOIC.D 96A UN, then System Parameter EDIMessageTypeParseString changed to EDIFACT_{MessageType}_{MessageVersionNumber}{MessageReleaseNumber} and saved, then the same invoice logged again and named EDIFACT_INVOIC_D96A next to the earlier one, and the pattern set back, animated walkthrough (7.12)][Hero]  
*Animated walkthrough: after the pattern changes, the next invoice gets the Message Type `EDIFACT_INVOIC_D96A`, while the invoice logged before keeps `INVOIC.D 96A UN`. The pattern was put back afterwards.*  

## :fa-table: At a Glance {#at-a-glance}

| Property | Value |
| --- | --- |
| Key | `EDIMessageTypeParseString` |
| Data type | string (pattern) |
| Default | `{MessageType}.{MessageVersionNumber} {MessageReleaseNumber} {ControllingAgencyCoded}` (with a space before the last two variables) |
| Read by | [Logging Service][] |
| Takes effect | Within about 15 seconds, for newly logged messages only; no restart needed |
| Status | ✅ Active |

## :fa-gears: How It Works

When the Logging Service works out the Message Type of an EDIFACT message from its body, it reads the UNH segment and replaces each variable in the pattern with the matching value. Text outside the braces is kept as written. The result becomes the Message Type name of the message.

The pattern is used only when all of these are true:

* The event asks for the Message Type from the body: it has the context option `ExtendedProperties/1.0#MessageTypeExtractFromBody` set to `true` (see [Context Options][]), or it comes through the [BizTalk Log Agent][].
* The body is neither XML nor JSON with a `$schema`.
* The body has a UNH segment.

A Message Type set explicitly with the context option `MessageTypeName` always takes precedence.

Take this UNH segment:

```text
UNH+1+ORDERS:D:96A:UN:EAN008'
```

With the default pattern, the Message Type name becomes `ORDERS.D 96A UN`.

### Pattern Variables

| Variable | UNH data element | Example value | Meaning |
| --- | --- | --- | --- |
| `{MessageReferenceNumber}` | 0062 | `1` | Message reference number, usually sequential |
| `{MessageType}` | 0065 | `ORDERS` | Message type, such as ORDERS, DESADV, INVOIC |
| `{MessageVersionNumber}` | 0052 | `D` | Message version number |
| `{MessageReleaseNumber}` | 0054 | `96A` | Message release number, such as 96A or 01B |
| `{ControllingAgencyCoded}` | 0051 | `UN` | Controlling agency (UN = UN/CEFACT) |
| `{AssociationAssignedCode}` | 0057 | `EAN008` | Association assigned code (optional in the message) |
| `{CodeListDirectoryVersionNumber}` | 0110 | `8` | Code list directory version number (optional in the message) |
| `{MessageTypeSubFunctionIdentification}` | 0113 | `1` | Message type sub-function identification (optional in the message) |

The optional components are read by their position in the message identifier (S009). An empty component keeps its place, so in `INVOIC:D:14B:UN:EAN010::1` the code list directory version is empty and the sub-function is still `1`. A value can contain the decimal mark, for example a code list directory version of `2.3`.

### Examples

| Pattern | UNH segment | Message Type name |
| --- | --- | --- |
| `{MessageType}.{MessageVersionNumber} {MessageReleaseNumber} {ControllingAgencyCoded}` (default) | `UNH+1+ORDERS:D:96A:UN:EAN008'` | `ORDERS.D 96A UN` |
| `{MessageType}.{MessageVersionNumber}{MessageReleaseNumber}{ControllingAgencyCoded}` (recommended, without spaces) | `UNH+1+ORDERS:D:96A:UN:EAN008'` | `ORDERS.D96AUN` |
| `EDIFACT_{MessageType}_{MessageVersionNumber}{MessageReleaseNumber}` (the walkthrough above) | `UNH+509010117+INVOIC:D:96A:UN'` | `EDIFACT_INVOIC_D96A` |
| `{MessageType}.{MessageVersionNumber}{MessageReleaseNumber}.{AssociationAssignedCode}` | `UNH+1+DESADV:D:01B:UN:EAN008'` | `DESADV.D01B.EAN008` |
| `EDIFACT.{MessageType}` | `UNH+1+INVOIC:D:96A:UN'` | `EDIFACT.INVOIC` |
| `{MessageType}.{MessageTypeSubFunctionIdentification}` | `UNH+1+INVOIC:D:14B:UN:EAN010::1'` | `INVOIC.1` |

### Impact on Message Types and Search Fields

* A changed pattern applies only to messages logged after the change. Existing [Message Types][] and logged messages keep their names, so for a while the same EDIFACT message can appear under two Message Type names.
* [Search Field Expressions][] are bound to Message Types. After a change, add the new Message Type names to the expressions that should keep extracting [Search Field][Search Fields] values, and check your [Log Views][].
* New Message Types get their retention settings when they are created; see [Add or manage Message Type][].

## :fa-lightbulb: Choosing a Value

* ✅ Keep the default, or use the recommended version without spaces. Both tell versions and releases apart, so each can have its own Search Field Expressions.
* Use a shorter pattern, such as `EDIFACT.{MessageType}`, when one set of expressions should apply to all versions of a message type.
* Use only variables that all your messages carry. A variable without a value in the UNH segment gives an incomplete name (for example a trailing `.`).
* Don't put `{`, `}`, or a variable's name (such as `MessageType`) as plain text in the pattern. Such a pattern is ignored: the message keeps its original Message Type name, and nothing is logged about it.
* Test a new pattern in a test environment with real messages from your trading partners, and check the resulting Message Type name in a Log View, before you change production.

## :fa-hand-point-right: Next Steps

* :fa-file: [Message Types][]  
* :fa-flask: [Search Field Expressions][]  
* :fa-pen-to-square: [Manage System Parameters][]  

## :fa-link-horizontal: Related Topics

* :fa-plus-square: [Add or manage Message Type][]  
* :fa-magnifying-glass-plus: [Search Fields][]  
* :fa-list-check: [Context Options][]  
* :fa-hard-drive: [Logging Service][]  
* :fa-cog: [System Parameters][]  

[Add or manage Message Type]:{ndr}/Getting%20Started/4.%20Repository/Message%20Types/Add%20or%20manage%20Message%20Type.md
[BizTalk Log Agent]:{ndr}/Logging%20and%20Monitoring/Microsoft%20BizTalk%20Server%20-%20Logging/Overview.md
[Context Options]:{ndr}/Core%20Services/Log%20Event/Features/Context%20Options.md
[Hero]:{ndm}/Documentation%20Pictures/IM/WebClient/Admin/Settings/SP/SystemParameters_EDIMessageTypeParseString.gif
[Log Views]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/What%20is%20a%20Log%20View.md
[Logging Service]:{ndr}/Core%20Services/Logging%20Service/Overview.md
[Manage System Parameters]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/Manage%20System%20Parameters.md
[Message Types]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[Search Field Expressions]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Overview.md
[Search Fields]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/What%20is%20a%20Search%20Field.md
[System Parameters]:{ndr}/Administration/5.%20Settings/5.%20System%20Parameters/Overview.md