# How to use variable in a JSON format?

**URL:** <https://discourse.nodered.org/t/how-to-use-variable-in-a-json-format/64094>\
**Category:** General\
**Created:** [18 June 2022 05:51 UTC](https://discourse.nodered.org/t/how-to-use-variable-in-a-json-format/64094 "2022-06-18T05:51:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauri](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Mauri](https://discourse.nodered.org/u/Mauri)\
**Post date:** [18 June 2022 05:51 UTC](https://discourse.nodered.org/t/how-to-use-variable-in-a-json-format/64094/1 "2022-06-18T05:51:28Z")

</div>

Hello everyone  
I would like to send some values ​​in a JSON format, but I want to use variables as placeholders for these values. Does anyone have an idea how to do this?

Thanks for your time!

Mauri

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [18 June 2022 05:59 UTC](https://discourse.nodered.org/t/how-to-use-variable-in-a-json-format/64094/2 "2022-06-18T05:59:34Z")

</div>

This is at the very core of node-red. I would suggest to go through the documentation and [how to work with messages](https://nodered.org/docs/user-guide/messages). To create a "template" for messages, you can use the [template node](https://nodered.org/docs/user-guide/nodes#template) as well.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [18 June 2022 11:46 UTC](https://discourse.nodered.org/t/how-to-use-variable-in-a-json-format/64094/3 "2022-06-18T11:46:46Z")

</div>

In addition, you can use JSONata to also do 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:** [17 August 2022 11:47 UTC](https://discourse.nodered.org/t/how-to-use-variable-in-a-json-format/64094/4 "2022-08-17T11:47:33Z")

</div>

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