How to store different function output in a single array or buffer

#1

how to store different founcton output in a single array array or buffer

0 Likes

#2

what do you mean by different?

Have you got a function that outputs more than one thing and you want to make an array? If so you can do that by pushing things into the array using standard javascript.

If you mean something else you need to provide more detail…

0 Likes

#3

like this...i want function1 and fuction 2 output store it in same a buffer.
for example output of function 1 is 10 and function 2 is 20 i want to store it in a common buffer
buffer[0]=10
buffer[1]=20

function

0 Likes

#4

first off, ui_text return data as you type it. If you are going to enter both itesm and want them put in an array, why not use ui_form instead. Then both fields aill be sent in the same msg when you hit submit.

0 Likes

#5

if have the code plz share it

0 Likes

#6

I think @zenofmud meant a ui_form node. Have a play with it to see how it works.

0 Likes

#7

i want the input from the text box only

0 Likes

#8

Do you mean that only one will be entered at a time, but you want the other one remembered in the array? If so you can use a join node for that. See
https://cookbook.nodered.org/basic/join-streams

0 Likes

#9

like that only but i want to do further calculation like addition buffer[0]+buffer[1]

0 Likes

#10

Well use the join node as in that link then you can do what you like in a function node after that.

0 Likes

#11

plz share the code if u have .i am new to this platform

0 Likes

#12

Oops, typo - I've corrected it to read ui_form

0 Likes

#13

Get the join node working first and see what you get. The link I posted includes code.
Then once you have got that going come and ask again if necessary.

0 Likes

#14

Also if you haven't read through the user guide then do so. A couple of hours spent doing that will save you (and us) time in the long run.
https://nodered.org/docs/user-guide/

0 Likes

#15

Also if you share what you have done it is easier to see which bit you understand / don’t understand.

0 Likes

#16

1.On click button get a pop up color pad
2
2.color pad....
1

3.Each color has different value .
example: color black =61440,RED=1,brown=2...etc

4.Then comes textbox value .
5.i want to add textbox value and color value.

example:-
1.if i select color black and textbox value is 4095
2.i want addition of color black value(61440) and text box value(4095)
3 dispay that one in result text boxCapture

0 Likes

#17

You keep reposting what you want, without showing us what you have already done in Node-RED.

Show us the CODE (not a screen shot of some nodes)

How are you getting the value of the colour?
How are you getting the number value?

0 Likes