# Msg.payload for vertical table

**URL:** https://discourse.nodered.org/t/msg-payload-for-vertical-table/77476
**Category:** Dashboard
**Tags:** node-red-dashboard
**Created:** [12 April 2023 06:28 UTC](https://discourse.nodered.org/t/msg-payload-for-vertical-table/77476 "2023-04-12T06:28:45Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Jhankhana](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@Jhankhana](https://discourse.nodered.org/u/Jhankhana)
#### Post date: [12 April 2023 06:28 UTC](https://discourse.nodered.org/t/msg-payload-for-vertical-table/77476/1 "2023-04-12T06:28:45Z")

</div>

Hello there!  
Need you help.

I am receiving data and has date using function. below Is what I have written in function node to pass those value in table node. that is giving me horizontal table.

```auto
msg.payload = [
    {
        "Date": printdate,  
        "Time": printtime,
        "Machine_ID": MachineID,
        "Customer_ID":CustomerID,
        "Customer_Name":CustomerName,
        "Date_of_Instolation":Instolationdate
    },
  ];

```

![Screenshot (79)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/0/30454ee2bf2d5365b75d90c969511b5605a497a1.png)

But I want to display it in vertical table.  
What should I write for that?  
 ![Screenshot (81)](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6dbd197475b67bbd922eda8488cdc0f87a357f7b.png)

---

<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: [12 April 2023 09:40 UTC](https://discourse.nodered.org/t/msg-payload-for-vertical-table/77476/2 "2023-04-12T09:40:29Z")

</div>

2 options.

1. Change your database query to return that shape of data (fastest)  
OR
2. Modify your function to change the shape of the data (slowest)

* * *

For item 2, this should work...

```auto
msg.payload = Object.entries(msg.payload[0])
return msg

```

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

---

<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: [12 May 2023 09:40 UTC](https://discourse.nodered.org/t/msg-payload-for-vertical-table/77476/3 "2023-05-12T09:40:36Z")

</div>

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