let firstResponse = pm.response.json();
let productId = firstResponse.results[0].productId;
let apiProviderId= firstResponse.results[0].apiProviderId;
let name= firstResponse.results[0].name;
I am just guessing this
Incase is results is an array with more than one element then you need to loop to get every productId,apiProviderId and name in the response.
@bpricilla thank you so much, for sure need to start somewhere. thanks for the understanding.
I have updated and it works, big thanks.
You are right, I copied just part of the results as 704 rows and didnt think I would need to add all.
Can I ask another question?
So now I am using this to set the variable to the environment, do you know if there is a cheat way so I dont have to type out all my 100s of variables?
let firstResponse = pm.response.json();
let productId = firstResponse.productId;
let apiProviderId = firstResponse.results[0].apiProviderId;
let name = firstResponse.results[0].name;
pm.environment.set('productId', productId);
pm.environment.set('apiProviderId', apiProviderId);
pm.environment.set('name', name);