# Variable substitution

**URL:** <https://community.postman.com/t/variable-substitution/33774>\
**Category:** Help Hub\
**Created:** [March 23, 2022, 6:37pm UTC](https://community.postman.com/t/variable-substitution/33774 "2022-03-23T18:37:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gxvigo](https://avatars.discourse-cdn.com/v4/letter/g/ee7513/32.png) [@gxvigo](https://community.postman.com/u/gxvigo)\
**Post date:** [March 23, 2022, 6:37pm UTC](https://community.postman.com/t/variable-substitution/33774/1 "2022-03-23T18:37:40Z")

</div>

Hi There,

I have an api request that uses Environment Variables:  
https://{{endpoint}}/v1/apps/{{projectId}}

Both variables are defined and with an initial value, if I hover on the Request URL I can see that both {{endpoint}} and {{projectId}} are correctly evaluated by the tool.

When I send my request, only {{endpoint}} is correctly substituted with my initial value, for {{projectId}} Postman assigns a random value (12345678901234567890123456789012).

Any clue why this is happening?

Cheers.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [April 4, 2025, 3:58pm UTC](https://community.postman.com/t/variable-substitution/33774/2 "2025-04-04T15:58:03Z")

</div>

We’re closing out older posts with no replies to keep the community organized. If you still need help with this issue, feel free to post a new topic. For variable substitution, the `pm.variables.replaceIn()` function can be used. More information can be found [here](https://learning.postman.com/docs/tests-and-scripts/write-scripts/postman-sandbox-api-reference/#use-variables-in-scripts).
