# Setting collection variable script not working even if using the correct syntax

**URL:** <https://community.postman.com/t/setting-collection-variable-script-not-working-even-if-using-the-correct-syntax/45085>\
**Category:** Help Hub\
**Tags:** tests, variables, collections\
**Created:** [March 13, 2023, 6:02pm UTC](https://community.postman.com/t/setting-collection-variable-script-not-working-even-if-using-the-correct-syntax/45085 "2023-03-13T18:02:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moumitapradhan](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@moumitapradhan](https://community.postman.com/u/moumitapradhan)\
**Post date:** [March 13, 2023, 6:02pm UTC](https://community.postman.com/t/setting-collection-variable-script-not-working-even-if-using-the-correct-syntax/45085/1 "2023-03-13T18:02:19Z")

</div>

**Your question may already have an answer on the community forum. Please search for related topics, and then read through the [guidelines](https://community.postman.com/t/about-the-just-getting-started-category/37) before creating a new topic.**

> Here’s an outline with best practices for making your inquiry.

_My question_: I was facing a problem in my Postman Application. I wrote a script to extract a data from a Json response and set it in the collection variables, though the script is passing…but I am unable to see the same in my collection variable section. Also when I am trying to create a new variable from the collection variable section itself, on selecting a text and clicking on set as variable, the extracted variable is showing in the collection. Weird issue! Can anybody help?

_Details (like screenshots)_:

 ![postmanissue](https://us1.discourse-cdn.com/getpostman/original/3X/6/1/61c3a23ca613d35cfb2b0689f66d425d646ca571.png)  
 ![postman isse](https://us1.discourse-cdn.com/getpostman/original/3X/f/a/fa6c671a146cd52692fd51059839123d7aa55a82.png)

_How I found the problem_:

_I’ve already tried_:
