Hello @Gugi@Alumio_Bot@Ruben I receive incoming Shopify order data in JSON format. Using an Entity Transformer, I convert this data into an EDI format. The Entity Transformer utilizes a Value Setter that uses object type to set value. The values for the EDI format are extracted from the JSON input using the syntax ‘&{}’. This process allows me to transform the Shopify order data into a standardized EDI format for further processing.
Now, in Shopify Orders, there are line_items that are dynamic. In EDI, there is a PO1 loop for adding Product quantities and their titles
Based on the provided image, the pattern “PO11" represents items[0], "PO1 2” represents items[1], and so on. These lines can repeat dynamically as “PO13" and beyond. Additionally, the "PID F” line is part of the PO1 loop, and its presence in the EDI format will also be dynamic. How can I achieve this in Alumio Entity Transformer?
Could you please let me know whether you have tried the entity transformer called Alumio - EDI - Serialize to map a JSON format into EDI? Or, do you want to transform your data manually into EDI using the transformer prototypes?
@Gugi Yes, I have tried to Convert the whole JSON to EDI using the entity transformer called Alumio - EDI - Serialize to map a JSON format into EDI but I got “Bad Request” Error
The line items should be mapped into the array Groups.0.Transactions.0.PO1Loop. Additionally, please leave the postfix parameter in the Request Parameters field as an empty string.
The above JSON format will be converted into the below output in X12-standard EDI.
@Gugi Thanks. I have created the required JSON format and now I am able to use Alumio - EDI - Serialize. Now, I have only one query about how I can handle the PO1 loop i.e. from line_items. I need to know how I can dynamically create an array of objects and use them with my parent data.
As there is also an assigned number which increments with each object i.e. PO11, PO12…
Therefore, how will I transform this?
@fahadmicro You can use the Node, transform nodes entity transformer to loop through the line_items in your Shopify order entity. Inside the node transformer, you can then transform each line item to match the Groups.0.Transactions.0.PO1Loop format.
However, in order to get the index of each line item, before entering the above Node transformer, you should put use the Move data between accessors to map the index of line_items array into an accessible property inside the each line_items object. See the below picture.