# Using subflow environment varibles directly within a http request URL?

**URL:** <https://discourse.nodered.org/t/using-subflow-environment-varibles-directly-within-a-http-request-url/89440>\
**Category:** General\
**Created:** [12 July 2024 08:25 UTC](https://discourse.nodered.org/t/using-subflow-environment-varibles-directly-within-a-http-request-url/89440 "2024-07-12T08:25:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RK\_aus\_S](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rk_aus_s/32/92170_2.png) [@RK\_aus\_S](https://discourse.nodered.org/u/RK_aus_S)\
**Post date:** [12 July 2024 08:25 UTC](https://discourse.nodered.org/t/using-subflow-environment-varibles-directly-within-a-http-request-url/89440/1 "2024-07-12T08:25:56Z")

</div>

Hi  
I've been searching for a while, but stay uncertain, all my try's failed so far:

Is there any chance or possibility in a subflow to use an environment variable (defined in the subflow properties button) _directly_ within an URL string, for example in a "http request" node?

As an example, I mean something like this:

URL: https//api.xyz.com/device/{{{here comes my var}}}/settings

or

URL: https//api.xyz.com/device/${here comes my var}/settings

Kind regards  
Roman

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [12 July 2024 08:41 UTC](https://discourse.nodered.org/t/using-subflow-environment-varibles-directly-within-a-http-request-url/89440/2 "2024-07-12T08:41:22Z")

</div>

You can not use env vars as part of a value, it must be the whole value.

A solution is to build the full URL before the http-request node and pass it in as `msg.url`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 October 2024 08:42 UTC](https://discourse.nodered.org/t/using-subflow-environment-varibles-directly-within-a-http-request-url/89440/3 "2024-10-10T08:42:18Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
