Hi,
Given the expression and input below using the Change node, the test function works fine however when running the trigger I get no output. I've looked at many other posts on here and suspect I am not properly referencing the payload but I cannot figure out how I should do that. I'm using v3.0.2
Input:
[
{
"Obj1": [
{
"Datetime": "2020-04-03 01:21:07.650",
"ID": "00001",
"code": "WAXXNNNX"
},
{
"Datetime": "2020-04-03 01:21:07.650",
"ID": "00002",
"code": "CAXXNNNX"
}
]
},
{
"Obj2": [
{
"X102": "Y",
"X116": "N",
"X435": "00001"
},
{
"X102": "Y",
"X116": "Y",
"X435": "00002"
}
]
}
]
Expression:
Obj1@$A.Obj2@$B[$B.X435=$string($A.ID)].{
'ID': $A.ID,
'Datetime': $A.Datetime,
'Code': $A.Code,
'X102_ZipSuffixFlag': $B.X102,
'X116_TerminationIDFlag': $B.X116
}
Flow Json/Code:
[
{
"id": "36dfb3f779a74351",
"type": "tab",
"label": "Flow 3",
"disabled": false,
"info": "",
"env": []
},
{
"id": "18696e4694de5bf1",
"type": "inject",
"z": "36dfb3f779a74351",
"name": "Main",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "[ { \"Obj1\": [ { \"Datetime\": \"2020-04-03 01:21:07.650\", \"ID\": \"00001\", \"code\": \"WAXXNNNX\" }, { \"Datetime\": \"2020-04-03 01:21:07.650\", \"ID\": \"00002\", \"code\": \"CAXXNNNX\" } ] }, { \"Obj2\": [ { \"X102\": \"Y\", \"X116\": \"N\", \"X435\": \"00001\" }, { \"X102\": \"Y\", \"X116\": \"Y\", \"X435\": \"00002\" } ] } ]",
"payloadType": "str",
"x": 1270,
"y": 60,
"wires": [
[
"53fa8b28361c395f"
]
]
},
{
"id": "53fa8b28361c395f",
"type": "json",
"z": "36dfb3f779a74351",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 1270,
"y": 120,
"wires": [
[
"b6fd2e4b79e75df8"
]
]
},
{
"id": "b6fd2e4b79e75df8",
"type": "change",
"z": "36dfb3f779a74351",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "Obj1@$A.Obj2@$B[$B.X435=$string($A.ID)].{\t 'ID': $A.ID,\t 'Datetime': $A.Datetime,\t 'Code': $A.Code,\t 'X102_ZipSuffixFlag': $B.X102,\t 'X116_TerminationIDFlag': $B.X116\t}\t",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1280,
"y": 180,
"wires": [
[
"4038a268a78e5ff2"
]
]
},
{
"id": "4038a268a78e5ff2",
"type": "debug",
"z": "36dfb3f779a74351",
"name": "debug 13",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1260,
"y": 240,
"wires": []
}
]