`SWITCH` node question about options

It would help if it was more verbose, but I guess its implied by "test the length of Strings"

It isn't the string "0" that is the issue, it is number 0 or any number for that matter. Neither 'is empty' nor 'is not empty' pass. That is implied by:
"The is empty and is not empty rules can be used to test the length of Strings, Arrays and Buffers, or the number of properties an Object has"
as Numbers do not appear in that list. However, the next sentence
"Neither rule will pass if the property being tested has a boolean, null or undefined value."
Should read
"Neither rule will pass if the property being tested has a numeric, boolean, null or undefined value."

What the node needs is a way to check has key on msg

You can test msg.key is null for that.

Hi Colin, what I meant was property msg then select has key important_piece. At the moment having just msg as a property is invalid

Yeah: silly me.

Yes, I know. I agree that occasionally that would be useful. I was pointing out that there is a workaround, which is to test the property for null.

Sorry Colin, I got so caught up in the is empty is not empty discussion I forgot that it was agreed right at the biggening that testing for null was the solution :blush:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.