Hi there
I am still learning how to work and construct payloads.
can you please assist me with this use-case?.
and here is the payload of the device state:
{
“time”: “2018-01-10T07:20:52.592Z”,
“data”: {
“Dn”: 0,
“Dm”: 0,
“Dx”: 315,
“Sn”: 0,
“Sm”: 0,
“Sx”: 0.4,
“Ta”: 13.8,
“Ua”: 83.5,
“Pa”: 1004.5,
“Rc”: 0.4,
“Sr”: 82.1,
“result”: {
“error”: {
“code”: 400,
“errors”: [
{
“message”: “No rows present in the request.”,
“domain”: “global”,
“reason”: “invalid”
}
]
}
}
},
“applicationId”: “xxx”,
“triggerId”: “xxx”,
“triggerType”: “deviceId”,
“relayId”: “xx”,
“relayType”: “device”,
“deviceTags”: {
“model”: [
“UTX-3117”
],
“location”: [
“Yair House”
],
“FW”: [
“1.0.0”
],
“DeviceRecipe”: [
“Advantech Gateway”
]
},
“deviceName”: “Yair Gateway”,
“flowVersion”: “develop”,
“flowId”: “xxx”,
“flowName”: “Save to google”,
“applicationName”: “AutoPivot”,
“globals”: {}
}
from which I’d like to structure a JSON that looks like:
{
“deviceName”: “Yair Gateway”,
“deviceId”: “xxxxxxx”,
“model”: “UTX3117”,
“TS”: “2018-01-10T07:20:52.592Z”,
“data”: {
“Dn”: 0,
“Dm”: 0,
“Dx”: 315,
“Sn”: 0,
“Sm”: 0,
“Sx”: 0.4,
“Ta”: 13.8,
“Ua”: 83.5,
“Pa”: 1004.5,
“Rc”: 0.4,
“Sr”: 82.1
}
}
Can I do it in the Table Data JSON Template in the bigquery node, or do I need to use the function node?
I am sure once I see this example, i’ll be able to go pretty far myself