Conditional mapping lets you perform mapping activities based on a condition or conditions. The condition might be whether data exists in a field or element or identify the trading partner with whom the mapped data is being exchanged.
Conditional mapping lets you process segments and elements differently based on the presence or absence of data in a field, on the identity of the trading partner, or on the specific data in an element, field or memory variable. For example, if the only N1 segment you expect to receive and process is for Ship To name information, you need to map only one N1 segment and can skip conditional mapping.
On the other hand, to process two N1 segments (both the Ship To and Bill To name information) and map the data to different fields, you must use conditional mapping to recognize and separately process the two segments. Another example is the varying requirements of different trading partners for mapping a segment. One trading partner may never want to see an N1 segment containing Bill To information. Another trading partner may want to see a name in N102, and a third may want to see a location in N104 and no data in N102. Conditional mapping takes care of all these requirements in one map. It lets you create one map that produces more than one output from the same input, based on conditions that you specify.
Segment and element conditional mapping allows you to account for many data conditions in one map. Conditional mapping that is trading-partner-specific allows you to tailor one map to accommodate varying individual trading partner requirements. While you often map one EDI data element to one application field or memory variable, you sometimes map an incoming EDI data element to multiple fields simultaneously. And often you do not want to map a certain element unless another element is also present.
Conditional mapping is different for inbound and outbound maps.
Inbound maps use conditional mapping at the segment level to map trading partner-specific segments to application fields.
Outbound maps generate trading partner-specific segments, and they also use conditional mapping at the segment level to generate a segment only if a record/field or memory variable condition is satisfied.
At the element level, inbound conditional mapping performs element to field mapping only if specified conditions are true. Outbound maps use conditional mapping at the element level to check whether a record/field or memory variable contains data, and if it does, to map the current element and either one or two other elements designated as conditional variables. Conditional variables are memory variables that the system creates for you.