# Help with what's going on with code

**URL:** https://discourse.nodered.org/t/help-with-whats-going-on-with-code/97736
**Category:** General
**Created:** [22 June 2025 11:12 UTC](https://discourse.nodered.org/t/help-with-whats-going-on-with-code/97736 "2025-06-22T11:12:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [22 June 2025 11:12 UTC](https://discourse.nodered.org/t/help-with-whats-going-on-with-code/97736/1 "2025-06-22T11:12:26Z")

</div>

I'll put my hand up right now.

I'm stupid. I've been looking at this for a long enough time, and can't see what is _WRONG_ with it.

Basically a message comes in.

`true` or `false`.

The code sticks an indication as the status and sends a message to a `text` node.

Either a RED or LIME _BULLS EYE_ is shown.

I was running in circles as it wasn't updating according to the message.

So I got to code swapping with another (similar) node and that works.

_(that is the 2 commented out lines)_

So why aren't the _longer versions_ working?

```auto
// These two lines work.
//msg.payload = (x == true) ? '<font color = "lime"> <i class="fa fa-bullseye fa-2x" ></i></font>' : '<font color = "red"> <i class="fa fa-bullseye fa-2x" ></i></font>'
//return msg

// But if I use this code, I get a `msg.payload` sent which looks the same but there is NOTHING
// displayed.
if (x == true)
{
    node.status({ fill: "green", shape: "dot", text: "Connected" })
    msg = { "payload": '<font color = "lime"> <i class="fa fa-bullsexe fa-2x" ></i></font>'}
}
else
{
    node.status({ fill: "red", shape: "dot", text: "Dis-Connected" })
    msg = { "payload": '<font color = "red"> <i class="fa fa-bullsexe fa-2x" ></i></font>'}
}

return msg

```

Failed payload  
`{"payload":"<font color = \"lime\"> <i class=\"fa fa-bullsexe fa-2x\" ></i></font>","_msgid":"17de3addd73b2d13"}`

Working payload  
`{"_msgid":"589efa1987a2d909","payload":"<font color = \"red\"> <i class=\"fa fa-bullseye fa-2x\" ></i></font>","topic":""}`

Someone?  
Please.

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [22 June 2025 11:17 UTC](https://discourse.nodered.org/t/help-with-whats-going-on-with-code/97736/2 "2025-06-22T11:17:01Z")

</div>

> [@Trying\_to\_learn](#):
>
> {"\_msgid":"589efa1987a2d909","payload":"\<font color = "red"\> \<i class="fa fa-bullseye fa-2x" \>","topic":""}

**Font Awesome icon class** `fa-bullsexe` — double-check the spelling.  
There is no official `fa-bullsexe`. Perhaps you meant:

- `fa-bullseye` ✅

---

<div class="post-metadata">

### Author: ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)
#### Post date: [22 June 2025 11:18 UTC](https://discourse.nodered.org/t/help-with-whats-going-on-with-code/97736/3 "2025-06-22T11:18:01Z")

</div>

> [@Trying\_to\_learn](#):
>
> Failed payload  
> `{"payload":"<font color = \"lime\"> <i class=\"fa fa-bullsexe fa-2x\" ></i></font>","_msgid":"17de3addd73b2d13"}`

**Font Awesome icon class** `fa-bullsexe` — double-check the spelling.  
There is no official `fa-bullsexe`. Perhaps you meant:

- `fa-bullseye` ✅

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [22 June 2025 11:18 UTC](https://discourse.nodered.org/t/help-with-whats-going-on-with-code/97736/4 "2025-06-22T11:18:18Z")

</div>

Thanks.

I couldn't see the wood for the trees.

Thanks.

(If only all were this easy to find.)  
😉

---

<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: [6 July 2025 11:18 UTC](https://discourse.nodered.org/t/help-with-whats-going-on-with-code/97736/5 "2025-07-06T11:18:34Z")

</div>

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