# Newbie question about templates

**URL:** <https://discourse.nodered.org/t/newbie-question-about-templates/99814>\
**Category:** General\
**Tags:** dashboard-2\
**Created:** [29 November 2025 20:25 UTC](https://discourse.nodered.org/t/newbie-question-about-templates/99814 "2025-11-29T20:25:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![condmaster](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@condmaster](https://discourse.nodered.org/u/condmaster)\
**Post date:** [29 November 2025 20:25 UTC](https://discourse.nodered.org/t/newbie-question-about-templates/99814/1 "2025-11-29T20:25:42Z")

</div>

Hello!

My first ever post here..  
How do I get the great windrose widget to respond as in this topic:

> [@Add compass mode to DB2 gauge widget](https://discourse.nodered.org/t/add-compass-mode-to-db2-gauge-widget/85806/7):
>
> Fixed couple more things, now it animates, takes short way to rotate over 0/360 like real life things do. Possibly I'll leave it for now as is. Hided code from previous post. Use this, it is better. \<template\> \<div class="windrose"\> \<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" width="100%" height="100%" viewBox="0 0 500 493"\> \<g\> \<circle cx="250" cy="247" r="205" class="ring" /\> \<g\> \<line class="s…

I only see 0 Directon and 0 Speed?

My Flow :

Inject Node (timestamp) -\> Function Node (Randomizer) -\> Template Node (Windrose)

The random number generator sends this to the windrose template:

```auto
var msg = {
    "payload": {
        "direction": Math.round(Math.random() * 360),
        "speed": Math.round(Math.random() * 25)
    }
}
return msg;

```

More info about the setup: [Images](https://imgur.com/a/QTkvjID)

BR Matte Nilsson

---

<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:** [29 November 2025 20:41 UTC](https://discourse.nodered.org/t/newbie-question-about-templates/99814/2 "2025-11-29T20:41:49Z")

</div>

From a quick glance, the template seems to expect a message either like this

```auto
{
   "topic": "speed",
   "payload": 29
}

```

or else like this

```auto
{
   "topic": "direction",
   "payload": 247
}

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/7/3727b4909c6f90967c1ee1e78dd1beb48f9b4bbe.png)

---

<div class="post-metadata">

**Author:** ![condmaster](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@condmaster](https://discourse.nodered.org/u/condmaster)\
**Post date:** [29 November 2025 20:56 UTC](https://discourse.nodered.org/t/newbie-question-about-templates/99814/3 "2025-11-29T20:56:13Z")

</div>

Thanks alot for the answer!  
Back to the drawing board.

/Matte

---

<div class="post-metadata">

**Author:** ![condmaster](https://avatars.discourse-cdn.com/v4/letter/c/c5a1d2/32.png) [@condmaster](https://discourse.nodered.org/u/condmaster)\
**Post date:** [29 November 2025 21:41 UTC](https://discourse.nodered.org/t/newbie-question-about-templates/99814/4 "2025-11-29T21:41:34Z")

</div>

You got me on the right track!  
Now it works! Many thanks!

/Matte

---

<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:** [13 December 2025 21:41 UTC](https://discourse.nodered.org/t/newbie-question-about-templates/99814/5 "2025-12-13T21:41:46Z")

</div>

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