Global functions via Collection level folder?

even this solution works:

utils = {
     sayHello: function (){
       console.log(Hello! ${name});
    }
};

But I have found that pm.environent.set doesn’t work in this function you created if that function is in a collection script, it works if that function is in the request

I can get the variable using pm.environent.get but not set it

Can anyone help on this?

1 Like