# Node.status using multiple variables

**URL:** <https://discourse.nodered.org/t/node-status-using-multiple-variables/43734>\
**Category:** General\
**Created:** [6 April 2021 00:20 UTC](https://discourse.nodered.org/t/node-status-using-multiple-variables/43734 "2021-04-06T00:20:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mick](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mick/32/80990_2.png) [@Mick](https://discourse.nodered.org/u/Mick)\
**Post date:** [6 April 2021 00:20 UTC](https://discourse.nodered.org/t/node-status-using-multiple-variables/43734/1 "2021-04-06T00:20:02Z")

</div>

I would like to be able to use the status node to show the status of multiple variables in my function. I can easily show one variable and have looked for examples but have not found any yet. The function:

> node.status({text:("Radio"+ " Client: "+ clientStatus)+ " Meter: "+ Meter,fill:red, shape:"dot"});

shows this output:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/f/bf4c758ee549f93366d42f33b41eeb69bd056e65.png)

I have 3 variables (Radio, Client, and Meter) and I would like to have the ability to show a red/green dot depending on the variable. Has anyone created a node.status with more than one variable?

---

<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:** [6 April 2021 06:30 UTC](https://discourse.nodered.org/t/node-status-using-multiple-variables/43734/2 "2021-04-06T06:30:29Z")

</div>

here is are two examplese using ternary conditional, you could use it in the node.status() or create a variable.

```auto
[{"id":"1ee4694e.f87fe7","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"meter","v":"5","vt":"num"},{"p":"clientStatus","v":"2","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":4320,"wires":[["7c38c87d.12ec4","f1483d45.a51088"]]},{"id":"7c38c87d.12ec4","type":"function","z":"5a245aa1.510164","name":"","func":"let clientStatus = msg.clientStatus, \nMeter = msg.meter;\nnode.status({text:(\"Radio\"+ \" Client: \"+ clientStatus)+ \" Meter: \"+ Meter,fill:(clientStatus > 2 ? \"red\" : \"green\"), shape:\"dot\"});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":4320,"wires":[["e094f5ce.cd258"]]},{"id":"f1483d45.a51088","type":"function","z":"5a245aa1.510164","name":"","func":"let clientStatus = msg.clientStatus, \nMeter = msg.meter,\ncolour = (clientStatus > 2 ? \"red\" : \"green\");\nnode.status({text:(\"Radio\"+ \" Client: \"+ clientStatus)+ \" Meter: \"+ Meter,fill:colour, shape:\"dot\"});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":290,"y":4380,"wires":[["f2f27d93.3e33e8"]]},{"id":"e094f5ce.cd258","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":480,"y":4320,"wires":[]},{"id":"f147f1f1.912f58","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"meter","v":"5","vt":"num"},{"p":"clientStatus","v":"4","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":4380,"wires":[["7c38c87d.12ec4","f1483d45.a51088"]]},{"id":"f2f27d93.3e33e8","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":460,"y":4380,"wires":[]}]

```

---

<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:** [5 June 2021 06:31 UTC](https://discourse.nodered.org/t/node-status-using-multiple-variables/43734/3 "2021-06-05T06:31:14Z")

</div>

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