Skip to content
background-image background-image

Convert EDIFACT to JSON & Acknowledge EDIFACT JSON

Hi! In this example we are going to discuss the EdiNation - Convert EDIFACT To JSON and the EdiNation - Acknowledge EDIFACT JSON connectors.

You can use our visual example in the video tutorial on our YouTube channel, you can continue to view our text version, or you can use both to better absorb the information.


Prerequisites

For successful integration between Integray and EdiNation, you need to authenticate your requests with an Authentication Token. You can obtain your Authentication Token HERE.


Connectors

For the configuration of the task, we will use the aforementioned EdiNation - Convert EDIFACT To JSON and the EdiNation - Acknowledge EDIFACT JSON connectors. The EdiNation - Convert EDIFACT To JSON connector is designed to transform EDIFACT messages into a JSON format, making them easier to process and integrate with modern applications. This conversion is crucial for systems that rely on JSON for data exchange and integration. On the other hand, the EdiNation - Acknowledge EDIFACT JSON connector is used to send acknowledgements for received EDIFACT messages. This ensures that the sender knows the message has been received and processed correctly, adhering to the necessary compliance and communication protocols.

Additionally, we will use the Integray Endpoint Connector with an endpoint on input, the Node.js processor, in which we remap the data to a text variable, and an JSON Array Splitter, which deletes the array from JSON.


Configuration

Add a new Task and name it Edifact To JSON and Acknowledge.

Add a first Task step:

  • Step name: Get EDIFACT JSON
  • Connector: Integray Endpoint Connector

Open the step's Task step editor by clicking the button with the pencil symbol. Fill in the configuration fields for your endpoint created in the example HERE.

HELP_ExampleLibrary_EdiNation_AcknowledgeEDIFACT_FirstStepConfiguration

Save the configuration and close the step.

After this step, there is an Node.js processor, in which we remap the data to a text variable.

Add a second Task step:

  • Step name: Extract EDIFACT
  • Connector: Node.js processor

Open the Task Step Editor, add the Input schema - JSON, and the Output schema - Text. Then, pin the input mapping.
Insert the following code into the Node.js statement configuration:

return [{
  "Text": inputData[0].JSON.Result[0].EDIFACT
}]
HELP_ExampleLibrary_EdiNation_AcknowledgeEDIFACT_SecondStepConfiguration

Save the configuration and close the step.

In the next step, we have the EdiNation - Convert EDIFACT To JSON connector, which transforms EDIFACT messages into a JSON format.

Add a third Task step:

  • Step name: Edifact to JSON
  • Connector: EdiNation - Convert EDIFACT To JSON

Open the Task Step Editor and pin the input mapping. Fill in the Base URL and Token fields and save the configuration.
Select error behavior and save the configuration again.

HELP_ExampleLibrary_EdiNation_AcknowledgeEDIFACT_ThirdStepConfiguration

In the next step is JSON Array Splitter, which deletes the array from JSON.

Add a forth Task step:

  • Step name: JSON Splitter
  • Connector: JSON Array Splitter

Open the Task Step Editor and make sure that the default Input and Output schemes are configured, and the Input mapping is already pinned.

HELP_ExampleLibrary_EdiNation_AcknowledgeEDIFACT_ForthStepConfiguration

And finally, the last step, where we use the EdiNation - Acknowledge EDIFACT JSON connector to send acknowledgements for received EDIFACT messages.

Add a fifth Task step:

  • Step name: Acknowledge EDIFACT
  • Connector: EdiNation - Acknowledge EDIFACT JSON

Open the Task Step Editor and make sure that the default Input and Output schemes are configured, and the Input mapping is already pinned. Select error behavior, and Fill in the configuration fields as shown in the screenshot below. Save the configuration. Fill in the Base URL and Token fields and save the configuration again.

HELP_ExampleLibrary_EdiNation_AcknowledgeEDIFACT_FifthStepConfiguration

Press the Publish button. We've configured the task, now let's start it.


Result - the EDIFACT was converted to JSON and successful acknowledgment message received

HELP_ExampleLibrary_EdiNation_AcknowledgeEDIFACT_FinishedSuccess

Upon successful completion, click on History and then in the last step, open the Data Snapshot. Here, if you open all details, you can see that the converter has changed EDIFACT in text format to JSON in JSON format. Also, here we can see the returned message from the acknowledge connector along with a success message indicating successful acknowledgement.

HELP_ExampleLibrary_EdiNation_AcknowledgeEDIFACT_Datasnapshot

The output from these connectors provides data that can be easily customized across all connectors, offering great flexibility and many options for modification. This allows it to meet any specific requirements.


That's all we wanted to show in this example. We hope you got the same result. We invite you to see our other examples.