# UI\_TABLE : How to add row at the end of the table

**URL:** https://discourse.nodered.org/t/ui-table-how-to-add-row-at-the-end-of-the-table/28215
**Category:** Dashboard
**Created:** [12 June 2020 08:48 UTC](https://discourse.nodered.org/t/ui-table-how-to-add-row-at-the-end-of-the-table/28215 "2020-06-12T08:48:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![PhilippeDEFORGE](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@PhilippeDEFORGE](https://discourse.nodered.org/u/PhilippeDEFORGE)
#### Post date: [12 June 2020 08:48 UTC](https://discourse.nodered.org/t/ui-table-how-to-add-row-at-the-end-of-the-table/28215/1 "2020-06-12T08:48:01Z")

</div>

Hi !  
I'm using the ui\_table, and I'm updating it dynamically with results of measurements done with STM32 microcontrollers.

The fonction " addResult" is looking like this:  
msg.payload=  
{  
command: "addRow",  
arguments: [  
{  
"Frequency":flow.get("currentFrequency"),  
"RSSI":flow.get("currentRSSI"),  
"SNR": flow.get("currentSNR"),  
"PER": flow.get("currentPER")  
},  
true  
],  
returnPromise: true  
}  
return msg;

and previously I've called a fonction "ClearTable" like this :

msg.payload=[{  
"Frequency":"",  
"RSSI":"",  
"SNR": "",  
"PER": ""  
}];  
return msg;

my concern is that the table is updated with the last result at the beginning of the table while I would prefer to see it at the end of the table.

Is there any solution ?  
Thanks for your help

---

<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: [12 June 2020 11:24 UTC](https://discourse.nodered.org/t/ui-table-how-to-add-row-at-the-end-of-the-table/28215/2 "2020-06-12T11:24:44Z")

</div>

Have a look in the Example section for the ui\_table when you select 'Import' on the right-hand of the screen.  
There's an example about... sending\_commands that covers adding a row at the bottom or top of the table.

Basically, I think all you need to do is change the boolean from true to false where I've indicated.

```auto
msg.payload=
{
command: "addRow",
arguments: [
{
"Frequency":flow.get("currentFrequency"),
"RSSI":flow.get("currentRSSI"),
"SNR": flow.get("currentSNR"),
"PER": flow.get("currentPER")
},
false <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
],
returnPromise: true
}
return msg;

```

---

<div class="post-metadata">

### Author: ![Christian-Me](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/christian-me/32/10774_2.png) [@Christian-Me](https://discourse.nodered.org/u/Christian-Me)
#### Post date: [12 June 2020 11:48 UTC](https://discourse.nodered.org/t/ui-table-how-to-add-row-at-the-end-of-the-table/28215/3 "2020-06-12T11:48:45Z")

</div>

All commands are documented:

> **[Tabulator - Interactive JavaScript Tables](http://tabulator.info/docs/4.0/update#retrieve-data)**
>
> Create interactive data tables in seconds with Tabulator. A lightweight, fully featured JavaScript table generation library.

There you can also find a clearData() command to effectively clear your table.

If you can work with an index field I mostly use updateOrAddData() to either insert rows or updating existing.

---

<div class="post-metadata">

### Author: ![PhilippeDEFORGE](https://avatars.discourse-cdn.com/v4/letter/p/ba8739/32.png) [@PhilippeDEFORGE](https://discourse.nodered.org/u/PhilippeDEFORGE)
#### Post date: [15 June 2020 08:06 UTC](https://discourse.nodered.org/t/ui-table-how-to-add-row-at-the-end-of-the-table/28215/4 "2020-06-15T08:06:52Z")

</div>

Thanks a lot ! It's working fine.

---

<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: [15 July 2020 08:06 UTC](https://discourse.nodered.org/t/ui-table-how-to-add-row-at-the-end-of-the-table/28215/5 "2020-07-15T08:06:53Z")

</div>

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