# Using Credentials variables in subflows

**URL:** <https://discourse.nodered.org/t/using-credentials-variables-in-subflows/36637>\
**Category:** General\
**Created:** [27 November 2020 17:31 UTC](https://discourse.nodered.org/t/using-credentials-variables-in-subflows/36637 "2020-11-27T17:31:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 November 2020 17:31 UTC](https://discourse.nodered.org/t/using-credentials-variables-in-subflows/36637/1 "2020-11-27T17:31:55Z")

</div>

I am using an http request node in a subflow. It requires basic authorisation with an API key as the username. I have declared a subflow property of credentials type called APIKey and in the request node in the subflow have put the username as `${APIKey}` and that works fine.

However, if I want to deploy the subflow to another system by export/import the key is lost in the subflow settings, which is as it should be, but unfortunately inside the subflow all the `${APIKey}` entries in the request nodes themselves are also lost. I can understand why. Is there any way around this? I wonder whether entering an env var spec in a credentials field should not actually be treated as a credential.

---

<div class="post-metadata">

**Author:** ![alexk111](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alexk111/32/16891_2.png) [@alexk111](https://discourse.nodered.org/u/alexk111)\
**Post date:** [3 December 2020 15:25 UTC](https://discourse.nodered.org/t/using-credentials-variables-in-subflows/36637/2 "2020-12-03T15:25:11Z")

</div>

I also vote for this.

---

<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:** [1 February 2021 15:25 UTC](https://discourse.nodered.org/t/using-credentials-variables-in-subflows/36637/3 "2021-02-01T15:25:26Z")

</div>

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