# Extract data from a JSON structure to be transferred into the table-ui

**URL:** https://discourse.nodered.org/t/extract-data-from-a-json-structure-to-be-transferred-into-the-table-ui/36588
**Category:** General
**Created:** [26 November 2020 20:59 UTC](https://discourse.nodered.org/t/extract-data-from-a-json-structure-to-be-transferred-into-the-table-ui/36588 "2020-11-26T20:59:32Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Sep](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Sep](https://discourse.nodered.org/u/Sep)
#### Post date: [26 November 2020 20:59 UTC](https://discourse.nodered.org/t/extract-data-from-a-json-structure-to-be-transferred-into-the-table-ui/36588/1 "2020-11-26T20:59:32Z")

</div>

Hi,  
I'm a newbie trying to put data into a table-ui by getting them from a JSON structure like the following.  
How to generate the array to be submitted to the table node?

Thanks in advance for the help.  
Sep

{  
"timestamp":"1606137562",  
"pid":"0",  
"serialnum":"20001",  
"device":{  
"model":"WBRIDGE",  
"data":[  
{  
"module":"system",  
"hwver":"01.00",  
"pwrmode":"power",  
"bootmode":"normal",  
},  
{  
"module":"wifi",  
"lanmac":"F008D1DC8AC8",  
}  
]  
},  
"sensor":{  
"history":[  
{  
"CNT\_ID":25,  
"CNT\_TIME":"1606136816",  
"SRC\_ID":"00002715",  
"DST\_ID":"0000276A",  
"DURATION":46  
},  
{  
"CNT\_ID":24,  
"CNT\_TIME":"1606136798",  
"SRC\_ID":"00002715",  
"DST\_ID":"0000276C",  
"DURATION":56  
}  
]  
}  
}

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [26 November 2020 21:25 UTC](https://discourse.nodered.org/t/extract-data-from-a-json-structure-to-be-transferred-into-the-table-ui/36588/2 "2020-11-26T21:25:09Z")

</div>

Can you also specify the output message that should be produced for the specified input which should be used as input for the table ui node?

I think this can be achieved by jsonata expression in a change node.

---

<div class="post-metadata">

### Author: ![Sep](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Sep](https://discourse.nodered.org/u/Sep)
#### Post date: [27 November 2020 08:32 UTC](https://discourse.nodered.org/t/extract-data-from-a-json-structure-to-be-transferred-into-the-table-ui/36588/3 "2020-11-27T08:32:19Z")

</div>

Hi janvda,

thanks for replying.  
It should be something like that

```auto
[ 
{"Name": "Kazuhito Yokoi","Age": "35", "Favourite Color": "red","Date Of Birth":12/09/1983" },
{"Name": "Oli Bob","Age": "12", "Favourite Color": "cyan","Date Of Birth":12/08/2017"}
]

```

basically an array of JSON oblects (?)

---

<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: [27 November 2020 09:39 UTC](https://discourse.nodered.org/t/extract-data-from-a-json-structure-to-be-transferred-into-the-table-ui/36588/4 "2020-11-27T09:39:29Z")

</div>

Yes - but your object is an object with two arrays inside it - one of which doesn't have repeating object types (so not really columns) - so we can only guess what you want as output ? maybe just the history data ? In which case use a change node to Move the msg.payload.sensor.history to msg.payload and feed that to the table node as a start.

---

<div class="post-metadata">

### Author: ![Sep](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Sep](https://discourse.nodered.org/u/Sep)
#### Post date: [27 November 2020 09:41 UTC](https://discourse.nodered.org/t/extract-data-from-a-json-structure-to-be-transferred-into-the-table-ui/36588/5 "2020-11-27T09:41:14Z")

</div>

yes, the main info I would need is the history

---

<div class="post-metadata">

### Author: ![Sep](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Sep](https://discourse.nodered.org/u/Sep)
#### Post date: [28 November 2020 10:41 UTC](https://discourse.nodered.org/t/extract-data-from-a-json-structure-to-be-transferred-into-the-table-ui/36588/6 "2020-11-28T10:41:49Z")

</div>

Many thanks, it worked.

---

<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 December 2020 10:41 UTC](https://discourse.nodered.org/t/extract-data-from-a-json-structure-to-be-transferred-into-the-table-ui/36588/7 "2020-12-12T10:41:58Z")

</div>

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