# Create json object with the content of multiple input text when a button is pressed

**URL:** <https://discourse.nodered.org/t/create-json-object-with-the-content-of-multiple-input-text-when-a-button-is-pressed/54693>\
**Category:** Dashboard\
**Created:** [3 December 2021 22:47 UTC](https://discourse.nodered.org/t/create-json-object-with-the-content-of-multiple-input-text-when-a-button-is-pressed/54693 "2021-12-03T22:47:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lescrisam](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@lescrisam](https://discourse.nodered.org/u/lescrisam)\
**Post date:** [3 December 2021 22:47 UTC](https://discourse.nodered.org/t/create-json-object-with-the-content-of-multiple-input-text-when-a-button-is-pressed/54693/1 "2021-12-03T22:47:12Z")

</div>

I have 3 text input in my ui and i would like to create a java object with the input-text content when a button is pressed for further processing.  
I tried to store the content of the inputtext in 3 context variables but i am obviously doing something wrong. please point me to the right direction.I spent the all day, but i do not understand what i am doing wrong.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 December 2021 00:48 UTC](https://discourse.nodered.org/t/create-json-object-with-the-content-of-multiple-input-text-when-a-button-is-pressed/54693/2 "2021-12-04T00:48:58Z")

</div>

Hi. Welcome to the forum.

> [@lescrisam](#):
>
> would like to create a java object

FYI, this JavaScript (very different from Java & such searching for help on Java will not get answers for JavaScript)

> [@lescrisam](#):
>
> I tried to store the content of the inputtext in 3 context variables but i am obviously doing something wrong

This is (one of the ways) you can approach the problem. What have you done and why does it not work? post a minimal flow demonstrating the issue & someone will help you out.

* * *

Note: it is important to surround your code/flow with three backticks

`````  
`like this`  
`````

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<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:** [4 December 2021 07:15 UTC](https://discourse.nodered.org/t/create-json-object-with-the-content-of-multiple-input-text-when-a-button-is-pressed/54693/3 "2021-12-04T07:15:18Z")

</div>

Have a look at the UI form node, where you can define the input fields and get a submit button that sends all the values together. Though that may not be what you want.

Otherwise have a look at the [this article in the cookbook](https://cookbook.nodered.org/basic/join-streams) for an example of how to join messages into one object.

---

<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:** [3 January 2022 07:15 UTC](https://discourse.nodered.org/t/create-json-object-with-the-content-of-multiple-input-text-when-a-button-is-pressed/54693/4 "2022-01-03T07:15:22Z")

</div>

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