# Asynchronous request using environment variables

**URL:** <https://community.postman.com/t/asynchronous-request-using-environment-variables/1585>\
**Category:** Help Hub\
**Created:** [May 10, 2018, 9:02am UTC](https://community.postman.com/t/asynchronous-request-using-environment-variables/1585 "2018-05-10T09:02:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meerkatjie](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/meerkatjie/32/102_2.png) [@Meerkatjie](https://community.postman.com/u/Meerkatjie)\
**Post date:** [May 10, 2018, 9:02am UTC](https://community.postman.com/t/asynchronous-request-using-environment-variables/1585/1 "2018-05-10T09:02:04Z")

</div>

I’m trying to prep a user with data needed before the test runs and so in my pre-request script I post data to an endpoint.

We have 3 different test environments where the endpoint is slightly different, e.g. [https://localhost:1234/v1/update](https://localhost:1234/v1/update) and [https://eu3-1.gb.stg.io:83/user/v1/update](https://eu3-1.gb.stg.io:83/user/v1/update), and because of this we have parameterised the service names and used them in our postman requests. They look something like this:

> country: gb  
> domain: stg  
> api\_environment: [https://eu3-1](https://eu3-1).{{country}}.{{domain}}.io:83  
> user\_service: {{api\_environment}}/user

However I cannot use them in my asynchronous request as using **pm.environment.get(“user\_service”) + ‘/v1/update’** returns **{{api\_environment}}/user/v1/update** which obviously fails as not a proper url.

Is there a way in postman to translate these variables so that the fully formed url is returned? Currently I am assuming that this is not possible and I’ll have to add a request beforehand just to set up the data.

---

<div class="post-metadata">

**Author:** ![kunagpal](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kunagpal/32/9_2.png) [@kunagpal](https://community.postman.com/u/kunagpal)\
**Post date:** [July 5, 2018, 9:03pm UTC](https://community.postman.com/t/asynchronous-request-using-environment-variables/1585/2 "2018-07-05T21:03:18Z")

</div>

@Meerkatjie You can use `pm.environment.get('var_name')` instead of `{{var_name}}`, which will achieve the desired effect 😄
