Hello I would like to have only one switch for the mulptiple payload I want to test.
But in a Switch Node we can put only one property I would like to put pultiple property because I need to add a new switch node for each test of my payload. I wan't only one switch node which do the work of all.
Actually I have this :
But I would like now to have this :
Can you give an example of the payloads you want to test against ?
Yes of course.
I give you one example of switch :
And for each switch I have the same test rules bue not the same msg.payload
The problem i that when my msg.payload.voltage is null I it returns the message that's why I used some switch.
I have this :
But I would like to have only one node for switch and one also for the treatment behind.
Use a function
You can select JSONata rather than !=
, and do the comparison of different properties in a JSONata expression
e.g.
[{"id":"e7e98c87.110e28","type":"switch","z":"30af2d3e.d94ea2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"jsonata_exp","v":"$$.payload.voltage != null","vt":"jsonata"},{"t":"jsonata_exp","v":"$$.payload.current != null","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":2,"x":290,"y":1040,"wires":[[],[]]}]
Yes thanks you it's working
Yes I made this also there is different solutions thanks for your help !
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.