# Using the SDK to copy pieces of one Collection to a new collection

**URL:** <https://community.postman.com/t/using-the-sdk-to-copy-pieces-of-one-collection-to-a-new-collection/24171>\
**Category:** Help Hub\
**Tags:** collections, sdk\
**Created:** [May 27, 2021, 3:04pm UTC](https://community.postman.com/t/using-the-sdk-to-copy-pieces-of-one-collection-to-a-new-collection/24171 "2021-05-27T15:04:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![derek.glidden](https://avatars.discourse-cdn.com/v4/letter/d/ee7513/32.png) [@derek.glidden](https://community.postman.com/u/derek.glidden)\
**Post date:** [May 27, 2021, 3:04pm UTC](https://community.postman.com/t/using-the-sdk-to-copy-pieces-of-one-collection-to-a-new-collection/24171/1 "2021-05-27T15:04:00Z")

</div>

I am working on a project with Postman and the SDK to programmatically take bits and pieces of one Collection and creating a new Collection out of them. We have a large number of tests and want to be able to create new Collections with only a subset of those tests.

(See also: [this github issue](https://github.com/postmanlabs/postman-app-support/issues/1535) which we are trying to work around.)

So far I am able to successfully move “Items” from one Collection to a new Collection, but am having difficulty figuring out how to get “Events” and “Variables” to copy over. I don’t want to have to manually initialize the values, as the purpose of this is to be able to entirely automate creation of new Collections for testing. I can extract a PostmanEventList and a PostmanVariableList from the source Collection, but nothing seems to work to “add” them to the new Collection. I just end up with empty Event and Variable sections.

If anyone can point me at some examples, or clarify the use of the SDK, that would be a big help.
