Hi,
I have some data feeding into the switch node which is in this format
msg.payload.rows[0].current_price
msg.payload.rows[0].ref_price
msg.payload.rows[0].quantity
I am trying to use the switch command to filter based on whether the current price is > the ref_price or not.
A pass is meant to go out the top output and I have the fail as an 'otherwise' to go out the other output.
From what I can tell the top parameter kind of has to be the msg.payload format
In the next part of the switch I have chosen the > symbol
Regarding the parameter to test against, it doesn't seem to matter what I choose the result is always the same. Pass or Fail, they both go out the top or the bottom output.
(in another use of the switch, I test for null or !=null and it works perfectly)
msg.payload.rows[0].old_price
msg.$
msg.0-9 (looking for a numeric I assume)
msg.abc looking for text but I thought maybe the numbers were seen as text
I have even tried {new_price} type commands.
Also have tried the 'stopping on first match' selector.
Can someone suggest what 'should be the correct method' as I am just trying all combinations and getting nowhere.