Text Input Node - can I pass in a Label?

I have a Text Input Node where I can hard code a fixed Label.

However, is there a means of passing label text in from a preceding Function Node? I have tried all the usual but have not found any means of doing this and the doc doesn't suggest it can be done. Searches haven't turned anything up.

here is a link to the things you can dynamicallly change in the base ui nodes:


and if you look thru it, the ui_text_input node only allows you to change the 'mode' and the 'delay'
1 Like

Thanks for that link.
I have a Text Input node that permits a value to be entered but the value can be in 1 of 2 units. e.g. °C or °F , so having the means to display the unit value in the label would have been nice.
I will faff around with a Text node and see how that looks with the value field containing the units value.
Thanks again.

Err - why not just pass in msg.label or whatever property you want ?
image

@dceejay that works for the ui_text node but not for the ui_text_input node
Oops. my mistake it works for both - I sent the lable as msg.payload and the time as msg.label

Just out of curiosity, can you change the group name in a pretty similar way? Via a flow variable? Since you cannot reach a group in the flow.

Or is it not possible at all to make a group name variable?

Thx.

correct - you cannot change groups dynamically.

@dceejay
This is not working - for me at least..
Spent a few hours trying to narrow this down and finally arrived a simple flow that demonstrates the failure.

The Inject node sets msg.label to "injectA" and payload to a numeric value of 1.
Deploy and view the result.
Then change the msg.label to "injectB" - leave the payload untouched.
Deploy and view - the label does not changed.
Now change the payload from 1 to 2 and leave msg.label untouched ("injectB").
Deploy and view - now the label has changed.
The label is only changing when the payload also changes.

The second example uses a function to set the label and payload.
The same scenario, the label is displayed correctly but only after a changed msg.payload value is set.

If you change the label but leave the payload untouched, the label is not redisplayed correctly. You have to change the payload to get the label to change to its new value.

[{"id":"1ea81ff3.8b21","type":"function","z":"a8343255.189ef","name":"change label","func":"msg.label = \"functionF\";\nmsg.payload = 1;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":250,"y":2380,"wires":[["24f98fa6.34248"]]},{"id":"24f98fa6.34248","type":"ui_text_input","z":"a8343255.189ef","name":"function","label":"{{msg.label}}","tooltip":"","group":"cf134869.6a9fc8","order":13,"width":0,"height":0,"passthru":true,"mode":"number","delay":"0","topic":"","x":420,"y":2380,"wires":[[]]},{"id":"1a5e48e8.f761a7","type":"inject","z":"a8343255.189ef","name":"","props":[{"p":"label","v":"injectedA","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":90,"y":2380,"wires":[["1ea81ff3.8b21","e511012c.37abf"]]},{"id":"e511012c.37abf","type":"ui_text_input","z":"a8343255.189ef","name":"injected","label":"{{msg.label}}","tooltip":"","group":"cf134869.6a9fc8","order":12,"width":0,"height":0,"passthru":true,"mode":"number","delay":"0","topic":"","x":240,"y":2320,"wires":[[]]},{"id":"cf134869.6a9fc8","type":"ui_group","z":"","name":"Batches","tab":"456ebde9.b22184","order":1,"disp":true,"width":"6","collapse":false},{"id":"456ebde9.b22184","type":"ui_tab","z":"","name":"Batch Setup","icon":"dashboard","order":4,"disabled":false,"hidden":false}]

Yes. Data is only passed to the front end if it changes. So yes if you want to change the label you need to send some data. You can send null if you need to force a change.

I am sending msg.label and msg.payload each time - is that not sufficient data?

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