How to set environment variable in postman collection runner?

Viewed 8131

I have an API named getcampaignlist. It returns me all campaign list with descriptions according to relevant person. Like in image I have multiple campaign with id and description. I want to set environment variable using

"postman.setEnvironmentVariable("cmid", jsonData.id);" or

"postman.setEnvironmentVariable("cmid", jsonData.id) where jsonData.campaignName==="online Games "; "

For clarification check image

I mean I want to use all these id's in loop through collection runner. how can I set values in environment variable. Because when I set jsonData.id it can't decide which id value should be set in environment variable "cmid" and return false.

2 Answers
Related