# Global functions via Collection level folder?

**URL:** <https://community.postman.com/t/global-functions-via-collection-level-folder/5927>\
**Category:** Help Hub\
**Created:** [June 16, 2019, 12:16pm UTC](https://community.postman.com/t/global-functions-via-collection-level-folder/5927 "2019-06-16T12:16:17Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![alvaro\_mv.co](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@alvaro\_mv.co](https://community.postman.com/u/alvaro_mv.co)\
**Post date:** [January 26, 2021, 5:56pm UTC](https://community.postman.com/t/global-functions-via-collection-level-folder/5927/11 "2021-01-26T17:56:05Z")

</div>

> [@franksunnn110](#):
>
> let obj = {};  
> obj.sayHello(‘Griffin’);

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?

---

_[View the full topic](https://community.postman.com/t/global-functions-via-collection-level-folder/5927)._
