EDI Reader
The EDI Reader component is designed to make it easy for you to work with complex electronic data files. It takes raw EDIFACT files—commonly used for sharing business documents like orders, invoices, and shipping notices—and automatically converts them into a clear, structured format that Nappai can understand.
Instead of dealing with messy text files, this component organizes the information into simple data fields (such as dates, parties, and line items). This makes it much easier to use the data in the next steps of your automation, such as adding it to a database or sending it via email.
How it Works
When you connect an EDIFACT file to this component, it performs the following steps internally:
- Reads the File: It opens the file you provide (whether it is a
.edibinary file or plain text). - Identifies the Message Type: It automatically looks at the beginning of the file to determine what kind of business document it is (e.g., an Order, an Invoice, or a Shipping Advice). You do not need to tell it which type it is; it figures it out for you.
- Parses the Data: It breaks down the rigid text structure into logical sections. For example, it separates the header information (like who sent it and when) from the actual details (like the items being ordered).
- Outputs Structured Data: It produces a clean data object that you can map to other components in your workflow.
Because it handles the technical complexity of the EDIFACT standard behind the scenes, you can focus on using the data rather than trying to decode it.
Connection & Credentials
This component does not require any external API keys or credentials. It processes files directly from your local environment or the Nappai storage.
Inputs
The following fields are available to configure this component.
-
EDI File: The source file you want to process. This can be a binary
.edifile or a text file containing EDIFACT data.- Visible in: All Operations
-
Include Raw Segments: A setting to include the original, unprocessed text segments in the output. You might need this if you need access to specific technical details that the standard parsing structure does not capture.
- Visible in: All Operations
Outputs
After processing the file, the component produces a Messages output. This output contains the structured data extracted from the EDIFACT file.
Output Data Example (JSON)
The output will typically look like a structured list of messages. Below is an example of what you can expect when mapping this data to the next step in your workflow: json [ { “unb”: { “interchange_sender”: “SELLER01”, “interchange_receiver”: “BUYER01”, “date”: “2023-10-27”, “time”: “10:30” }, “unh”: { “message_reference”: “ORD001”, “message_type”: “ORDERS”, “version”: “D96A” }, “segments”: { “BGM”: { “document_type_code”: “220”, “document_number”: “PO-98765” }, “NAD”: { “party_function_code”: “BY”, “party_id”: “SUPPLIER123” }, “LIN”: [ { “item_number”: “1”, “product_id”: “SKU-001”, “quantity”: “10” }, { “item_number”: “2”, “product_id”: “SKU-002”, “quantity”: “5” } ] }, “raw_segments”: [ “UNB+UNOC:3+SELLER01+BUYER01+231027:1030+98765”, “UNH+1+ORDERS:D:96A:UN” ] } ]
Note: The raw_segments field is only populated if you checked the “Include Raw Segments” input.
Connectivity
This component is typically used at the beginning of a data processing workflow.
- Connected To: Data Transformation components (like Mappers), Validation tools, or Database writers.
- Why: Since this component outputs structured data (JSON/Object), it is the perfect starting point for workflows that need to read, validate, or store business documents.
Usage Example
Scenario: Processing Incoming Purchase Orders
- Input: You receive a bulk folder of
.edifiles from a supplier. - Component: Use the EDI Reader to read one file at a time (or in a loop).
- Result: The component outputs the order details (items, quantities, customer info).
- Next Step: Connect the “Messages” output to a Database Writer to save the new orders into your inventory system.
Tips and Best Practices
- File Format: Ensure your input files are standard EDIFACT files (
.ediextension or text). Non-standard formats may cause parsing errors. - Debugging: If you encounter issues with missing data, try enabling Include Raw Segments. This allows you to see the exact text structure the system saw, which is helpful for debugging complex files.
- Auto-Detection: You don’t need to specify if the file is an Order or an Invoice. The component automatically detects the type based on the file content.
Security Considerations
- Data Integrity: The component is designed to parse data safely. However, always ensure that the source EDIFACT files are from trusted suppliers to prevent the ingestion of malicious or malformed data structures.