Iterating a list of users in postman

Hi @j_who,

Yep! That should work, except of using setNextRequest, I would just script out the http call directly in the test script. So given our previous posts in this thread, you should have enough info on how to do this, using this syntax mentioned above. For the service_task_ids array, I would create an array of service_task objects, so that you can use the “dot” syntax for each service task that you iterate over, I have a rough example below, this should cover - #2 and #3. I assume #1 is self explanatory, that being the Postman request you create in the UI.

service_task_list.forEach(function (service_task) {

pm.sendRequest({
url: url,
method: "POST",
header: {
    'Authorization': 'Basic ' + btoa('username:password')
},
body: {
        mode: 'raw',
        raw: JSON.stringify({ service_task_id: "{{service_task.id}}", description: "{{service_task.description}}" }) //etc, etc
    }
}, function (err, res) {
console.log("Sent Activation!")
});
})

I know this is a bit of a rough outline, but I hope it helps! Depending on how you organize the data in your csv file, you can create the service_tasks objects in the script, or your read the json object from the file. Let me know if you would like some clarity on that. In my opinion, it would be easier to just have the json object in the csv file, unless you have other places you need to use pieces of that data.

Thanks,
Orest