Currently i am facing to an issue which is related to a lookup function (function or any other node). Therefore i have a "mapping table" which is an array and this array contains objects (configured as a flow variable). The array is looking like this example:
The upcoming input messages have the following message format:
{
"id":"862277d7-7cb2-4ba3-a6d5-470a9b7a1ff0",
"value":"this is my new value",
"timestamp":"1663864965"
}
The idea was to create a function where the id of the message will be looked up in the array of objects. When the lookup was successfull (match is available) then the label shall be copied to the message. When the lookup was not successfull, the message can be dropped / filtered.
{
"id":"862277d7-7cb2-4ba3-a6d5-470a9b7a1ff0",
"value":"this is my new value",
"timestamp":"1663864965",
"label":".TEST_1"
}
I also tried the JSONata lookup function inside a switch node, but this one does also not work.
Does anybody have an idea how to solve that issue?