Postman Runner posting a json array using a data file

Hey @colin.mutch

Great to have you as part of the Postman community :trophy:

As it looks like you’re using all the values and in the same structure from the file, you can just take the whole object.

Adding this in the Pre-request Script:

pm.variables.set(`requestBody`, JSON.stringify(pm.iterationData.toObject()))

Add then adding the variable to the Request Body:

{{requestBody}}

When the Collection Runner does it’s magic, it will grab the data from the file and the script in the Collection will use it in the POST request.

The outcome will be something like this (This is using the Postman Echo service):

1 Like