# Set initial value of collection variables

**URL:** <https://community.postman.com/t/set-initial-value-of-collection-variables/56274>\
**Category:** Help Hub\
**Tags:** tests, variables, collections\
**Created:** [January 7, 2024, 5:11pm UTC](https://community.postman.com/t/set-initial-value-of-collection-variables/56274 "2024-01-07T17:11:07Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [January 15, 2024, 3:07pm UTC](https://community.postman.com/t/set-initial-value-of-collection-variables/56274/12 "2024-01-15T15:07:01Z")

</div>

I’ve just tested a quick patch request to one of my collections and it shows immediately after you refresh the page. (This is using the web app).

```auto
{
    "collection": {
        "variables": [
            {
                "key": "var1",
                "value": "value3",
                "type": "string"
            },
            {
                "key": "var2",
                "value": "value4",
                "type": "string"
            }
        ]
    }
}

```

![image](https://us1.discourse-cdn.com/getpostman/original/3X/2/2/22d776f0882f00928e80496ac40266fde5901536.png)

If the variables don’t exist, then it will create two new ones and copy the initial value to the current value.

If the variables exist, then it will only update the initial value.

---

_[View the full topic](https://community.postman.com/t/set-initial-value-of-collection-variables/56274)._
