# I Have Issue on MQTT to function and Template

**URL:** <https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874>\
**Category:** General\
**Tags:** node-red-dashboard, function-node, mqtt\
**Created:** [20 May 2022 07:14 UTC](https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874 "2022-05-20T07:14:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![riimeister](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@riimeister](https://discourse.nodered.org/u/riimeister)\
**Post date:** [20 May 2022 07:14 UTC](https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874/1 "2022-05-20T07:14:41Z")

</div>

I have a problem when I want to create a dashboard template.

the following is the raw data from the sql server that I have and I want to make a dashboard

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/6/b6214e8107f6bd5faac1255ffcf17e8a1a1c05c8.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f19644fcb27583b079dfe7b148a2378d39ed34fb.png)

in the data I want to create a dashboard using the if else method or whatever,  
The first one I want to make is if the **DL11\_LINE\_SPEED data is "0" the dashboard display will change to CO1/CO2/C3/etc status until MC,**  **but when the DL11\_LINE\_SPEED data \> 0** it will display speed numbers. what are the steps? I've tried using var failed.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [20 May 2022 07:27 UTC](https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874/2 "2022-05-20T07:27:53Z")

</div>

The red triangle indicates an error in your function node but you have not shown us the code.

It would be helpful to see what your debug nodes display rather than a spreadsheet style presentation of the data.

---

<div class="post-metadata">

**Author:** ![riimeister](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@riimeister](https://discourse.nodered.org/u/riimeister)\
**Post date:** [20 May 2022 07:30 UTC](https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874/3 "2022-05-20T07:30:31Z")

</div>

ust

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/a/ea6e6293384abc3e71c2d424c9806a49e1790046.png)

I just made it to display the speed numbers only. for the status if not run I have not made.

---

<div class="post-metadata">

**Author:** ![riimeister](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@riimeister](https://discourse.nodered.org/u/riimeister)\
**Post date:** [20 May 2022 07:31 UTC](https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874/4 "2022-05-20T07:31:59Z")

</div>

this for example dashboard, what I want to add here is if the machine is not running/speed "0" then the dashboard will display the status either CO/CO2/CO3/etc until MC like the data in sql server

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2a182cd593b64198725a013c2c1fc547a1aab46.png)

---

<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:** [20 May 2022 07:45 UTC](https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874/5 "2022-05-20T07:45:30Z")

</div>

It would help if you could post your flow and a sample of what you see at the 'Speed' debug node.

---

<div class="post-metadata">

**Author:** ![riimeister](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@riimeister](https://discourse.nodered.org/u/riimeister)\
**Post date:** [20 May 2022 07:50 UTC](https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874/6 "2022-05-20T07:50:33Z")

</div>

this flow debug node

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/c/4cbe4957e60f41d886703d6983b7c0cce36ed679.png)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [20 May 2022 08:15 UTC](https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874/7 "2022-05-20T08:15:35Z")

</div>

![Untitled 1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/8/1873213551f0a20542ee298561dd99ebf7ff0c92.jpeg)

---

<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:** [19 July 2022 08:15 UTC](https://discourse.nodered.org/t/i-have-issue-on-mqtt-to-function-and-template/62874/8 "2022-07-19T08:15:38Z")

</div>

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