# Pass CSV file to only 1 post request in a runner collection

**URL:** <https://community.postman.com/t/pass-csv-file-to-only-1-post-request-in-a-runner-collection/39359>\
**Category:** Help Hub\
**Tags:** variables, collections\
**Created:** [September 22, 2022, 7:12am UTC](https://community.postman.com/t/pass-csv-file-to-only-1-post-request-in-a-runner-collection/39359 "2022-09-22T07:12:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [September 22, 2022, 10:27am UTC](https://community.postman.com/t/pass-csv-file-to-only-1-post-request-in-a-runner-collection/39359/2 "2022-09-22T10:27:51Z")

</div>

The only way I can think of doing this is to have your 778 objects as a single JSON string in your CSV file.

You can then import this into a single variable.

This needs to be parsed, and converted into an array.

At which point you can craft a forEach loop using sendRequest() in the Tests tab for the Lock Workspace. This means that “Create firewall address” won’t be a separate request.

It needs to be an array, as forEach won’t work with a JavaScript object which is initially created when you parse the data.

Have a look at the following link, as there is a useful function for working with arrays that will probably benefit you.

[http://techslides.com/how-to-parse-and-search-json-in-javascript](http://techslides.com/how-to-parse-and-search-json-in-javascript)

```auto
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
    var objects = [];
    for (var i in obj) {
        if (!obj.hasOwnProperty(i)) continue;
        if (typeof obj[i] == 'object') {
            objects = objects.concat(getObjects(obj[i], key, val));    
        } else 
        //if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not)
        if (i == key && obj[i] == val || i == key && val == '') { //
            objects.push(obj);
        } else if (obj[i] == val && key == ''){
            //only add if the object is not already in the array
            if (objects.lastIndexOf(obj) == -1){
                objects.push(obj);
            }
        }
    }
    return objects;
}

```

Have a look at the following for an example of using the function with an array.

[https://community.postman.com/t/get-multiple-values-with-in-an-array](https://community.postman.com/t/get-multiple-values-with-in-an-array)

---

_[View the full topic](https://community.postman.com/t/pass-csv-file-to-only-1-post-request-in-a-runner-collection/39359)._
