# Substituting a variable in the JSON object used to for an http call

**URL:** <https://discourse.nodered.org/t/substituting-a-variable-in-the-json-object-used-to-for-an-http-call/94774>\
**Category:** General\
**Created:** [21 January 2025 09:50 UTC](https://discourse.nodered.org/t/substituting-a-variable-in-the-json-object-used-to-for-an-http-call/94774 "2025-01-21T09:50:11Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![ziga](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ziga/32/98138_2.png) [@ziga](https://discourse.nodered.org/u/ziga)\
**Post date:** [22 January 2025 00:41 UTC](https://discourse.nodered.org/t/substituting-a-variable-in-the-json-object-used-to-for-an-http-call/94774/21 "2025-01-22T00:41:44Z")

</div>

> [@invictagunner](#):
>
> `global.set("xxxxxRefreshToken", token )`

`global.set("xxxxxRefreshToken", token.trim() );`

> **[String.prototype.trim() - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim)**
>
> The trim() method of String values removes whitespace from both ends of this string and returns a new string, without modifying the original string.

---

<div class="post-metadata">

**Author:** ![invictagunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/invictagunner/32/98006_2.png) [@invictagunner](https://discourse.nodered.org/u/invictagunner)\
**Post date:** [22 January 2025 00:54 UTC](https://discourse.nodered.org/t/substituting-a-variable-in-the-json-object-used-to-for-an-http-call/94774/22 "2025-01-22T00:54:30Z")

</div>

Brilliant, thank you very much for this solution. 😀

---

<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:** [5 February 2025 00:54 UTC](https://discourse.nodered.org/t/substituting-a-variable-in-the-json-object-used-to-for-an-http-call/94774/23 "2025-02-05T00:54:52Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/substituting-a-variable-in-the-json-object-used-to-for-an-http-call/94774.md?page=1)
