# Generate Dynamic Lines in EDI File

**URL:** <https://forum.alumio.com/t/generate-dynamic-lines-in-edi-file/616>\
**Category:** General\
**Tags:** edi\
**Created:** [May 29, 2023, 10:34am UTC](https://forum.alumio.com/t/generate-dynamic-lines-in-edi-file/616 "2023-05-29T10:34:58Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Gugi](https://forum.alumio.com/user_avatar/forum.alumio.com/gugi/32/236_2.png) [@Gugi](https://forum.alumio.com/u/Gugi)\
**Post date:** [May 30, 2023, 1:58pm UTC](https://forum.alumio.com/t/generate-dynamic-lines-in-edi-file/616/6 "2023-05-30T13:58:38Z")

</div>

@fahadmicro You can use the [Node, transform nodes](https://forum.alumio.com/t/node-transformer/348) 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](https://forum.alumio.com/t/move-data-between-accessors/284) to map the index of `line_items` array into an accessible property inside the each `line_items` object. See the below picture.

 ![image](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/1X/792d21639758035ccb5ec64e4d899af84719279f.png)

The above transformer will result in the below `PO1loop` array.

```auto
{
  "PO1loop": [
    {
      "index": "0", // the index
      "line_item": {
        ...
        "id": 669751112,
        "price": "199.99",
        "product_id": 7513594,
        "quantity": 1,
        "requires_shipping": true,
        "sku": "IPOD-342-N",
        "title": "IPod Nano",
        "variant_id": 4264112,
        "variant_title": "Pink",
        ...
      }
    },
    {
      "index": "1", // the index
      "line_item": {
        ...
        "id": 669751113,
        "price": "199.99",
        "product_id": 7513594,
        "quantity": 1,
        "requires_shipping": true,
        "sku": "IPOD-342-N",
        "title": "IPod Nano",
        "variant_id": 4264112,
        "variant_title": "Pink",
        ...
      }
    }
  ]
}

```

You can use the Node transformer to loop through the `PO1loop` array instead of looping through the original `line_items` array.

---

_[View the full topic](https://forum.alumio.com/t/generate-dynamic-lines-in-edi-file/616)._
