# Text Input Node - can I pass in a Label?

**URL:** <https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061>\
**Category:** Dashboard\
**Created:** [26 August 2020 20:56 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061 "2020-08-26T20:56:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![davej](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/davej/32/25150_2.png) [@davej](https://discourse.nodered.org/u/davej)\
**Post date:** [26 August 2020 20:56 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/1 "2020-08-26T20:56:01Z")

</div>

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.

---

<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:** [26 August 2020 21:16 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/2 "2020-08-26T21:16:54Z")

</div>

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

> <https://github.com/node-red/node-red-dashboard/blob/master/config-fields.md>

  
and if you look thru it, the ui\_text\_input node only allows you to change the 'mode' and the 'delay'

---

<div class="post-metadata">

**Author:** ![davej](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/davej/32/25150_2.png) [@davej](https://discourse.nodered.org/u/davej)\
**Post date:** [26 August 2020 22:16 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/3 "2020-08-26T22:16:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [27 August 2020 08:06 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/5 "2020-08-27T08:06:07Z")

</div>

Err - why not just pass in msg.label or whatever property you want ?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/5/05967580e3b5321d23fdf87301cc0998943859dd.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:** [27 August 2020 10:48 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/6 "2020-08-27T10:48:21Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![ArneR](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/arner/32/95658_2.png) [@ArneR](https://discourse.nodered.org/u/ArneR)\
**Post date:** [27 August 2020 11:41 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/7 "2020-08-27T11:41:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [27 August 2020 11:42 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/8 "2020-08-27T11:42:36Z")

</div>

correct - you cannot change groups dynamically.

---

<div class="post-metadata">

**Author:** ![davej](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/davej/32/25150_2.png) [@davej](https://discourse.nodered.org/u/davej)\
**Post date:** [27 August 2020 18:52 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/9 "2020-08-27T18:52:00Z")

</div>

@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.

```auto
[{"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}]

```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [27 August 2020 19:08 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/10 "2020-08-27T19:08:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![davej](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/davej/32/25150_2.png) [@davej](https://discourse.nodered.org/u/davej)\
**Post date:** [27 August 2020 19:10 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/11 "2020-08-27T19:10:15Z")

</div>

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

---

<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:** [26 September 2020 19:10 UTC](https://discourse.nodered.org/t/text-input-node-can-i-pass-in-a-label/32061/12 "2020-09-26T19:10:19Z")

</div>

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