# Gauge node - conditional formatting

**URL:** <https://discourse.nodered.org/t/gauge-node-conditional-formatting/96020>\
**Category:** Dashboard\
**Created:** [15 March 2025 16:20 UTC](https://discourse.nodered.org/t/gauge-node-conditional-formatting/96020 "2025-03-15T16:20:03Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [16 March 2025 09:23 UTC](https://discourse.nodered.org/t/gauge-node-conditional-formatting/96020/4 "2025-03-16T09:23:08Z")

</div>

JSON is a formatting of the data but when you are coding you are using javascript. You can see the format of a javascript if statement at [w3school.com](http://w3school.com):  
[JavaScript if else else if](https://www.w3schools.com/js/js_if_else.asp)

Not knowing what your data looks like, I can't tell you what the if statement should look like.

You need to show what the msg going into the `function` node is so add a `debug` node (set to display the complete msg object) to the node sending the msg to the `function` node.

Copy and paste the output to a reply

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

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)

You should also take a [JavaScript Tutorial](https://www.w3schools.com/js/default.asp)

---

_[View the full topic](https://discourse.nodered.org/t/gauge-node-conditional-formatting/96020)._
