# Input Text Button Value into a JSON object

**URL:** <https://discourse.nodered.org/t/input-text-button-value-into-a-json-object/72130>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [13 December 2022 13:35 UTC](https://discourse.nodered.org/t/input-text-button-value-into-a-json-object/72130 "2022-12-13T13:35:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Asad.Khan](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@Asad.Khan](https://discourse.nodered.org/u/Asad.Khan)\
**Post date:** [13 December 2022 13:35 UTC](https://discourse.nodered.org/t/input-text-button-value-into-a-json-object/72130/1 "2022-12-13T13:35:21Z")

</div>

Hy! i am having an issue. I want to take the input value that is comming from text input and i want to store it in text field of JSON object. Is there ant solution. In short whatever i type in input node i want it to be stored in the text key of JSON object

---

<div class="post-metadata">

**Author:** ![Asad.Khan](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@Asad.Khan](https://discourse.nodered.org/u/Asad.Khan)\
**Post date:** [13 December 2022 13:35 UTC](https://discourse.nodered.org/t/input-text-button-value-into-a-json-object/72130/2 "2022-12-13T13:35:39Z")

</div>

![java](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0d123217e75878063231fab5a2ff7705b4980a97.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 December 2022 13:54 UTC](https://discourse.nodered.org/t/input-text-button-value-into-a-json-object/72130/3 "2022-12-13T13:54:23Z")

</div>

> [@Asad.Khan](#):
>
> i want it to be stored in the text key of JSON object

I'm sure there is a solution but what do you mean by `the text key of JSON object``? I could interpret that many ways. Please create a object showing what you want the result to be.

Note, there are `JSON strings` and `Javascript objects` but no `JSON objects`

---

<div class="post-metadata">

**Author:** ![Asad.Khan](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@Asad.Khan](https://discourse.nodered.org/u/Asad.Khan)\
**Post date:** [13 December 2022 13:59 UTC](https://discourse.nodered.org/t/input-text-button-value-into-a-json-object/72130/4 "2022-12-13T13:59:33Z")

</div>

In the image you can see that in STATUSTEXT object in the key "text" i have manually written an "abc" string. What i want is that instead of manually typing a string in the text key, whatever value i type in Input text node. It should replace "abc"

 ![1PNG](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/c/fc6d00e94b30bbd8630ce26d1649a0aec24239bf.png)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [13 December 2022 14:18 UTC](https://discourse.nodered.org/t/input-text-button-value-into-a-json-object/72130/5 "2022-12-13T14:18:01Z")

</div>

You can use the mustache temple and output as a parsed json object.  
e.g.

```auto
[{"id":"c58e944566ea08f7","type":"ui_text_input","z":"452103ea51141731","name":"","label":"","tooltip":"","group":"2d4fe667.28f8ba","order":17,"width":0,"height":0,"passthru":false,"mode":"text","delay":"0","topic":"topic","sendOnBlur":true,"className":"","topicType":"msg","x":240,"y":4060,"wires":[["15160b97726f7ed7"]]},{"id":"15160b97726f7ed7","type":"template","z":"452103ea51141731","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{\n \"name\":\"input name\",\n \"parameters\": {\n \"test\": \"{{payload}}\"\n }\n}","output":"json","x":440,"y":4060,"wires":[["830147a4173859b2"]]},{"id":"830147a4173859b2","type":"debug","z":"452103ea51141731","name":"debug 111","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":590,"y":4040,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":2,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

Template Node

```auto
{
    "name":"input name",
    "parameters": {
        "test": "{{payload}}"
    }
}

```

---

<div class="post-metadata">

**Author:** ![Asad.Khan](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@Asad.Khan](https://discourse.nodered.org/u/Asad.Khan)\
**Post date:** [13 December 2022 15:00 UTC](https://discourse.nodered.org/t/input-text-button-value-into-a-json-object/72130/6 "2022-12-13T15:00:16Z")

</div>

It worked, thanks for the help

---

<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:** [27 December 2022 15:00 UTC](https://discourse.nodered.org/t/input-text-button-value-into-a-json-object/72130/7 "2022-12-27T15:00:57Z")

</div>

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