Demo


#1. Importing template EDI segments and elements

  • In this example our EDI file is EDI X12 837 release 5010 but same steps apply to all EDI message types
  • We import template and check important template properties
  • Setup input file and run translation
  • Since output side is not setup we only examine extracted data in Data tab

#2. Modify imported EDI template

  • EDI template may not match exact layout of EDI segments you have. Real world EDI implementations vary a lot
  • Copy and Paste segments or whole groups of segments to match layout you have
  • This tends to be most complex of all mapping tasks
  • It is also task where EDI skills help. Usually takes many repeated adjustments to get layout right
  • Since output side is not setup we only examine extracted data in Data tab
  • In this example HL segments are nested and Condition/ConditionType is used to distinguish them
  • If warnings show up in the Log tab that indicates mismatch between your input file and the map
  • Adjust map by moving or adding segments. Set Condition/ConditionType on segments
  • Watch another video on this page about Condition/ConditionType property and warnings in Log tab

#3. Importing CSV field names from sample file

  • Our CSV file has field names in the first row
  • We import it with "By-Example" Wizard and add more fields using Copy and Paste
  • Same steps apply when CSV is translation input or output

#4. Manual setup of CSV field names and working with multi-level CSV

  • Our CSV has multiple levels: Header, Detail, Subdetail, etc.
  • We import basic CSV with "By-Example" Wizard just to get started and add more fields using Copy and Paste
  • We add both Header and Subdetail CSV lines
  • Header has to always have field names as first line. We set it via Format property =Value() function
  • We also set Mandatory=true on all fields that have to be produced in the output and will not be mapped
  • Same steps apply when CSV is translation input or output

#5. Basic mapping steps

  • We scroll down to important item on the left input side
  • Select items on the left and right side
  • Map them using right click pop-up menu
  • Run map to see actual live data populated in table format for selected item
  • Select both input and output items to see live data after map runs

#6. Steps for setting up paths and separators

  • One way to set paths is via DataPath properties but in this example we use Runtime Parameters screen to setup input and output paths.
  • Wildcards and macros used to grab all input text files and produce output files with unique names
  • Disable separator auto-detection for this map's EDI input files
  • Our trading partner is sending files with invalid ISA segments and refuses to fix the problem on they end
  • Usually auto-detect works fine. But this EDI input comes with corrupt ISA segment as a result auto-detect does not work.
  • We set separators manually to fixed values. That way translation still works even if incoming EDI file is slightly invalid.

#7. Steps for filtering EDI segments based on element qualifiers

  • We have situation where two NM1 segments can have element #1 qualifiers 41 and 40
  • Each NM1 based on qualifier should be mapped to different output fields.
  • We will use Condition/ConditionType properties to distinguish one NM1 segment from the other based on value in element #1
  • Choose existing NM1. Set its Condition to 41 and ConditionType to FirstNestedItemEqualsTo
  • Copy segment and paste another NM1 just below
  • Set its Condition to 40 and ConditionType to FirstNestedItemEqualsTo
  • Map new segment elements to output
  • Note: each segment maps to different output fields
  • We run map to see actual live data

#8. Steps for adding CSV output field

  • Our CSV file has '|' pipe separated fields.
  • Commas and other separators can be used here as well. But commas might be present in address data. Pipes tend to be safer alternative.
  • Right click on the output side and add element
  • Enter '|' pipe separator into EndTag property
  • Set Mandatory to 'true'. This will ensure that field is always produced in the output even if there is no data for it in the input
  • Map input to new output field
  • Check produced output by running the map
  • Make sure our CSV service line ends with carriage return and line feed entered as codes #13#10 in EndTag property

#9. Steps for mapping subelements

  • We map subelements. They are initially mapped same way as elements
  • But once mapping is established it is modified to target specific subelement
  • While this video shows EDI subelement on input side same steps apply for mappings when EDI subelement is on the output side
  • In all cases Mappings screen is used to alter the mapping from element mapping to specific subelement mapping

#10. Steps dealing with warnings

  • We run map and see warnings in the Log tab
  • Translator shows warnings if input file contains segments that are not setup in the map
  • Segment might be setup in the map but have Condition/ConditionType set on it preventing the match with incoming data
  • If you have large input file single error in segment setup may generate multiple warnings. It is clearly the case in this video.
  • Easiest way to find what is failing is to examine Log tab
  • Log usually contains first input segment that does not have a match (segment that is not setup correctly in the map)
  • If map contains few setup errors then log may be harder to dissect
  • Number of segments in the log match number of segments that did not get processed by the map
  • Never run map in production if you have warnings in the Log tab

#11. Showcase of complete 837 to CSV map

  • We revisit important input and output properties
  • First input separators are setup for whole EDI file
  • Auto-detect separators should be 'true' for most maps. Only maps that work with corrupted files need manual separators
  • Then each segment has StartTag property setup
  • Then each segment may also have Condition and ConditionType properties setup
  • We check that HI segment has subelements mapped using Mappings screen
  • After input examination we move on to the output side
  • Each CSV line ends with carriage return and line feed entered as #13#10 in EndTag properties
  • Each CSV field ends with '|'
  • All output fields have Mandatory property set to 'true' to always produce at least empty field and separator in the output.
  • First field called 'Reserved' has constant value setup via Format property. Everytime map runs it produces text 'Header' in that field.
  • We run the map and check translation data

Bonus. Pro tips

  • If you have sample input data: start mapping from input side (left)
  • If you have few input files use smaller one. That way you can run map faster and iterate on changes quicker
  • When mapping input side first you can always have map in working state. Even if translation data is only displayed in Data tab
  • As you map save backup copies of the mapping file. If something goes wrong you can go back to last known working state
  • Map by moving in small increments: make a change, run map to see that it still works, check data in Data tab, repeat...