# How to display multi-numbers in single node in dashboard 2

**URL:** <https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [19 April 2024 15:38 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346 "2024-04-19T15:38:40Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)\
**Post date:** [19 April 2024 15:38 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/1 "2024-04-19T15:38:40Z")

</div>

Dash V2.0 text in node does [not currently support multi-payloads](https://github.com/FlowFuse/node-red-dashboard/issues/390). The suggestion is to use the v2 template node.  
Unfortunately, after about 2 hours, I can't work out how to put more than one msg. into the v2 template without crashing dash v2 (you have to close both the dash and editor tabs in Firefox or Chrome then open the editor only, try and fix and deploy, then test by opening a dashboard tab - if will wrong both will crash, rinse and repeat).

I have tired so many combinations I just cant list them all here.

My question seems simple.  
I'd like to have two numbers in the one gadget (like the text in node in Dash v1).  
Here is an example of what I am trying to do in dash v2.  
Just display some text `KRIV Total: ` then two number with a ' : ' between.

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 April 2024 15:58 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/2 "2024-04-19T15:58:22Z")

</div>

> [@thebaldgeek](#):
>
> The suggestion is to use the v2 template node.

Are you sure that is the suggestion? I would have thought a core template node (not ui-template) would be the way to work around the issue. Alternatively build the string in a Function node, or using JSONata in a Change node.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 April 2024 16:02 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/3 "2024-04-19T16:02:17Z")

</div>

A template node containing something like  
`{{kriv}} : {{countkriv}}`  
should do it I think.

---

<div class="post-metadata">

**Author:** ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)\
**Post date:** [19 April 2024 16:16 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/4 "2024-04-19T16:16:01Z")

</div>

> [@Colin](#):
>
> Are you sure that is the suggestion?

I can really only go by what @joepavitt has mentioned in that GitHub link I posted:

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

I have to admit, after 2 hours of trying combinations, I never thought to drop the msg part.

Here is my count going up:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/30ae89364c8ecec262e15a832240ea21fa1bd59e.png)

My template node:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/34a34e7f6368d7c52fd87f9be1a6791cfe166da0.png)

And the dashboard:

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

I thought I recall reading somewhere that the template node in v2 needed some sort of `v-html` to display msg payloads?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 April 2024 16:29 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/5 "2024-04-19T16:29:15Z")

</div>

I think Joe is referring to a template, not ui-template.

Edit: fed into a text node of course.

---

<div class="post-metadata">

**Author:** ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)\
**Post date:** [19 April 2024 16:41 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/6 "2024-04-19T16:41:12Z")

</div>

@Colin solution of building what is needed in a function node seems to be the cleanest work around.

Here is my function node:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/9/d94c7eb5b0b11a814ea0fec7d4fed369bfc5a53c.png)

Then in the template node:

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

Do note that without the `<pre` tags the dashboard and editor tabs will crash. So don't be tempted to leave it out.

The dashboard now shows the expected data.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 April 2024 17:00 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/7 "2024-04-19T17:00:13Z")

</div>

I still think you would be better with a template node and a text node.  
The template is easier than the function node.

---

<div class="post-metadata">

**Author:** ![thebaldgeek](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thebaldgeek/32/93523_2.png) [@thebaldgeek](https://discourse.nodered.org/u/thebaldgeek)\
**Post date:** [19 April 2024 17:04 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/8 "2024-04-19T17:04:14Z")

</div>

In the 10 or so years of using Node-RED I cant recall ever using a template node, so have no experience with that.  
ie, you may well be right, but without any example of using them in Dash 2.0 (which seems to be a very different animal from anything else in Node-RED thus far), I am unable to test / compare.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 April 2024 20:47 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/9 "2024-04-19T20:47:40Z")

</div>

> [@thebaldgeek](#):
>
> without any example of using them in Dash 2.0

The core template node is nothing to do with either dashboard, it is just generates a string.  
In a template put  
`KRIV msg count: {{kriv}} : {{countkriv}}`  
and feed that straight into a ui-text node.

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [20 April 2024 04:02 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/10 "2024-04-20T04:02:52Z")

</div>

> [@thebaldgeek](#):
>
> Do note that without the `<pre` tags the dashboard and editor tabs will crash. So don't be tempted to leave it out.

Initially that was my take as well, however I now have my ui-template working fine without the pre tags. It is being fed directly from a ui-table, with no other nodes in between.

There may well be a bug in the ui-template lurking somewhere. I recall I needed to restart NR to fix the dashboard being unresponsive after I removed the pre tags.

This is what is in my ui-template node ...

```auto
<template>
    <div>
        <h2>Selected:</h2><br>
        Initial date {{msg.payload.incursion_date}}<br><br>
        Cost - ${{msg.payload.price}}<br>
        Arrival Time - {{msg.payload.arrival_time}}<br><br>
        Instructions - {{msg.payload.instructions}}<br>
    </div>
  </template>

```

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [23 April 2024 10:19 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/11 "2024-04-23T10:19:30Z")

</div>

> [@thebaldgeek](#):
>
> Dash 2.0 (which seems to be a very different animal from anything else in Node-RED thus far)

Always open to feedback @thebaldgeek, sorry to hear you're having so many issues with Dashboard 2.0. Have done my best to make sure it's aligned with Dashboard 1.0 where possible, but there is still more to catch up on.

Feature requests and bug reports are always welcome.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 April 2024 10:40 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/12 "2024-04-23T10:40:19Z")

</div>

I believe that @thebaldgeek was confused by the suggestion to use a Template node to overcome the fact that the features provided by the Value Format field are not yet supported. It seems he understood this referred to the ui-template node, rather than the core template node.

@thebaldgeek have you tried my suggestion of inserting a core Template node in front of the text node, containing the equivalent of the Value Format field. So in this case a Template node containing  
`KRIV msg count: {{kriv}} : {{countkriv}}`

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 April 2024 11:26 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/13 "2024-04-23T11:26:52Z")

</div>

It may or may not have been written down in a post or issue somewhere but:

The whole mustasche syntax in a field is something I am not 100% convinced is something the dashboard nodes should carry over from dashboard 1.

In dashboard 1, it was an approximation (not a full implementation) of mustasche and is not something most people are actually familiar with. Yes, I understand those coming from dashboard 1 (those who learned about it) used and found useful however, a goal most nodes should aim for is "do one thing and do it well". The regular `template` node does a FULL implementation of mustasche and was designed for doing that - templating strings.

Additionally, there are other issues with just letting dynamic values be used like this.

Dashboard 2 does a lot of things and provides a huge array of features (thanks in part to vuetify) that we never had access to in V1. Should we really carry the sins of V1?

to be clear: What I do support is dynamic labels (via a typedInput for `msg.what.ever.prop.you.desire`), just not the pseudo mustasche templating stuff.

Just my 2cent

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [23 April 2024 13:31 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/14 "2024-04-23T13:31:28Z")

</div>

Some of pseudo mustache stuff was the angular 1 filters - and was quite useful for formatting numbers etc - but yes if vuetify etc has some sort of equivalent then I'd be all for dropping it as it's "language" specific and not something we want to re-invent.

---

<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:** [7 May 2024 13:32 UTC](https://discourse.nodered.org/t/how-to-display-multi-numbers-in-single-node-in-dashboard-2/87346/15 "2024-05-07T13:32:05Z")

</div>

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