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

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
}
]
}
}

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.

Hi janvda,

thanks for replying.
It should be something like that

[ 
{"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 (?)

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.

yes, the main info I would need is the history

Many thanks, it worked.

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