Hello my dear supporter
i am stucking at the following "problem":
I get two payloads:
{"ASYS":{"BOARD_REQUIREMENT":[{"$":{"l_MsgId":"359","s_Type":"AES03 Speed","s_SerNum":"077576","l_lane":"1","l_value":"0","l_pass":"0"}}]}}
{"ASYS":{"BOARD_DELIVERY":[{"$":{"l_MsgId":"369","s_Type":"AES03 Speed","s_SerNum":"077576","l_lane":"1","l_value":"1","l_pass":"0"}}]}}
Basically I dont wanna use the switch node, because, first I have to switch for Delivery and Requirement and after that to switch if value is 1 or 0.
I wanna have a function like:
If (("REQUIRMENT" == 1) && ("DELIVERY" == 0))
{ msg.payload = "MAGAZINunload_ready";
return [msg, null] // output 0
}
else if (("REQUIRMENT" == 0) && ("DELIVERY" == 1))
{ msg.payload = "MAGAZINunload_done";
return [null, msg] // output 0
}
But I have no Idea how to search the words nor how to combine the two payloads in one to search each cases for the word which are on the top level of the array object.
The word l_value I am setting to a variable and use it later in an if/else:
l_value = msg.payload.ASYS.BOARD_REQUIREMENT[0].$.l_value;