# Postman collection programmatically generated does not contain an item in subfolder when imported in Postman

**URL:** <https://community.postman.com/t/postman-collection-programmatically-generated-does-not-contain-an-item-in-subfolder-when-imported-in-postman/13618>\
**Category:** Help Hub\
**Tags:** collections\
**Created:** [June 23, 2020, 6:12pm UTC](https://community.postman.com/t/postman-collection-programmatically-generated-does-not-contain-an-item-in-subfolder-when-imported-in-postman/13618 "2020-06-23T18:12:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MishaBindra](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@MishaBindra](https://community.postman.com/u/MishaBindra)\
**Post date:** [June 23, 2020, 6:12pm UTC](https://community.postman.com/t/postman-collection-programmatically-generated-does-not-contain-an-item-in-subfolder-when-imported-in-postman/13618/1 "2020-06-23T18:12:44Z")

</div>

Hi ,

I have generated a postman collection using the postman SDK (postman-collection).When I import the programmatically generated collection into postman , my subfolder (my-folder-3) is missing the item , although I can clearly see that item in the generated JSON collection:

This is my code:

```
myCollection = new Collection({
  "item": [{
      "id": "my-folder-1",
      "name": "my-folder-1",
      "item": [\*] // blank array indicates this is a folder
  }]
}); 

myCollection.items.one("my-folder-1").items.add(new ItemGroup({
  "name": "my-folder-2",
  "id": "my-folder-2",
  }));

myCollection.items.one("my-folder-1").items.one("my-folder-2").items.add(new Item({
  "name": "Send a GET request in my folder 2",
  "id": "my-get-request",
  "request": {
      "url": "https://postman-echo.com/",
      "method": "POST"
  }
}));

myCollection.items.one("my-folder-1").items.add(new ItemGroup({
  "name": "my-folder-3",
  "id": "my-folder-3",
  }));

myCollection.items.one("my-folder-1").items.one("my-folder-3").items.add(new Item({
  "name": "Send a GET request in my folder 3",
  "id": "my-get-request",
  "request": {
      "url": "https://postman-echo.com/",
      "method": "POST"
  }
}));

fs.writeFileSync("../autogenerated_collections" + "/test1.json", JSON.stringify(myCollection))

```

This is the generated collection that I try to import in Postman:

{“item”:[{“id”:“my-folder-1”,“name”:“my-folder-1”,“item”:[{“id”:“my-folder-2”,“name”:“my-folder-2”,“item”:[{“id”:“my-get-request”,“name”:“Send a GET request in my folder 2”,“request”:{“url”:{“protocol”:“https”,“path”:[""],“host”:[“postman-echo”,“com”],“query”:,“variable”:},“method”:“POST”},“response”:,“event”:}],“event”:},{“id”:“my-folder-3”,“name”:“my-folder-3”,“item”:[{“id”:“my-get-request”,“name”:“Send a GET request in my folder 3”,“request”:{“url”:{“protocol”:“https”,“path”:[""],“host”:[“postman-echo”,“com”],“query”:,“variable”:},“method”:“POST”},“response”:,“event”:}],“event”:}],“event”:}],“event”:,“variable”:,“info”:{"\_postman\_id":“590db509-3aac-435e-982a-97ca754f4938”,“schema”:“[https://schema.getpostman.com/json/collection/v2.1.0/collection.json](https://schema.getpostman.com/json/collection/v2.1.0/collection.json)”}}

---

<div class="post-metadata">

**Author:** ![MishaBindra](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@MishaBindra](https://community.postman.com/u/MishaBindra)\
**Post date:** [June 23, 2020, 8:25pm UTC](https://community.postman.com/t/postman-collection-programmatically-generated-does-not-contain-an-item-in-subfolder-when-imported-in-postman/13618/2 "2020-06-23T20:25:47Z")

</div>

Hello,

I figured out the issue:

The id used for the 2 items being added to seperate item groups was the same and that was causing the issue .
