# Modifying items and rows on 2.0 tables

**URL:** https://discourse.nodered.org/t/modifying-items-and-rows-on-2-0-tables/86268
**Category:** Dashboard
**Created:** [8 March 2024 10:48 UTC](https://discourse.nodered.org/t/modifying-items-and-rows-on-2-0-tables/86268 "2024-03-08T10:48:40Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ektoekto](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ektoekto/32/89084_2.png) [@ektoekto](https://discourse.nodered.org/u/ektoekto)
#### Post date: [8 March 2024 10:48 UTC](https://discourse.nodered.org/t/modifying-items-and-rows-on-2-0-tables/86268/1 "2024-03-08T10:48:40Z")

</div>

Hi,

I tried to follow the template script tutorial, where you could specify an item and then tell it to be Celcius or to change the background color. I'm guessing that the issue is my item names.

In one table they are like this:

```auto
data = [
    {
        "Sijainti": "Yläkerran vuokratila",
        "Tila": ylakerta.tila,
        "Lämpötila": ylakerta.temp,
        "kosteus": ylakerta.rh,
        "aikaleima": ylakerta.time,
        "Paristo": ylakerta.batt
    },
    {
        "Sijainti": "Kellari",
        "Tila": kellari.tila,
        "Lämpötila": kellari.temp,
        "kosteus": kellari.rh,
        "aikaleima": kellari.time,
        "Paristo": kellari.batt
    }
]

```

Lämpötila = temperature . On the second table the data is like this:

```auto
data = [
    {
        "Piiri": "Patterikierto",
        "tila": POL368.HMI1tila,
        [POL368.HMI03100Read[1][15]]: POL368.HMI03100Read[0][15],
        [POL368.HMI03100Read[1][10]]: POL368.HMI03100Read[0][10],
        [POL368.HMI03100Read[1][20]]: POL368.HMI03100Read[0][20],
        [POL368.HMI03100Read[1][21]]: POL368.HMI03100Read[0][21]
    },
    {
        "Piiri": "Puhallinkierto",
        "tila": POL368.HMI2tila,
        [POL368.HMI03200Read[1][15]]: POL368.HMI03200Read[0][15],
        [POL368.HMI03200Read[1][10]]: POL368.HMI03200Read[0][10],
        [POL368.HMI03200Read[1][20]]: POL368.HMI03200Read[0][20],
        [POL368.HMI03200Read[1][21]]: POL368.HMI03200Read[0][21]
    },
    {
        "Piiri": "Käyttövesi",
        "tila": POL368.HMI3tila,
        [POL368.HMI03200Read[1][15]]: POL368.HMI04100Read[0][6],
        [POL368.HMI03200Read[1][10]]: POL368.HMI04100Read[0][7],
        [POL368.HMI03200Read[1][20]]: POL368.HMI04100Read[0][9],
        [POL368.HMI03200Read[1][21]]: POL368.HMI04100Read[0][10]
    }
]

```

Here the name is taken from an array. Again, how would I reference that item or a row?

---

<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: [8 March 2024 10:53 UTC](https://discourse.nodered.org/t/modifying-items-and-rows-on-2-0-tables/86268/2 "2024-03-08T10:53:43Z")

</div>

Hi @ektoekto, welcome to the forum.

> [@ektoekto](#):
>
> the template script tutorial

Which template script tutorial is that? (link?)

> [@ektoekto](#):
>
> I'm guessing that the issue is my item names

What is your issue? Getting an error? Null values? Undefined values?

> [@ektoekto](#):
>
> Here the name is taken from an array

What name?

> [@ektoekto](#):
>
> Again, how would I reference that item or a row

Which item, which row?

* * *

Show us your data (debug message) explain what you need to put where.

Additionally, you say "template" however you are assigning an array to something called `data` - templates are NOT javascript and cannot do assignment. Is tis actually a function node?

* * *

More details and more context please.

---

<div class="post-metadata">

### Author: ![ektoekto](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ektoekto/32/89084_2.png) [@ektoekto](https://discourse.nodered.org/u/ektoekto)
#### Post date: [8 March 2024 11:02 UTC](https://discourse.nodered.org/t/modifying-items-and-rows-on-2-0-tables/86268/3 "2024-03-08T11:02:23Z")

</div>

Sorry for my poor explanation. Here's the example:

> **[UI Template Examples | Node-RED Dashboard 2.0](https://dashboard.flowfuse.com/user/template-examples.html)**
>
> Documentation for Node-RED Dashboard 2.0, a collection of nodes to build out data visualisations and dashboards in Node-RED

```auto
 <template v-slot:item.target="{ item }">
        <!-- Add a custom suffix to the value for the "target" column -->
        {{ item.target }}°C
      </template>

```

Here you can see that he uses "item.target" to add a °C column named target. I tried to do the same by adding a template-element before my table, but nothing happens and I don't get any errors. I was thinking that my issue could be that the column name is "Lämpötila" and that could be the issue? Although I did try to change the column name for something simpler.

How are you supposed to add the celcius thing to the value?

And how would you change the bc color of an item or a row depending of the value of item?

---

<div class="post-metadata">

### Author: ![ektoekto](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ektoekto/32/89084_2.png) [@ektoekto](https://discourse.nodered.org/u/ektoekto)
#### Post date: [8 March 2024 14:40 UTC](https://discourse.nodered.org/t/modifying-items-and-rows-on-2-0-tables/86268/4 "2024-03-08T14:40:38Z")

</div>

I got it 😐

The example is an table of it self, I don't need the UI table element. The whole thing lives inside the template.

This can definitively be roved.

---

<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 April 2024 14:40 UTC](https://discourse.nodered.org/t/modifying-items-and-rows-on-2-0-tables/86268/5 "2024-04-07T14:40:42Z")

</div>

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