Single space getting passed to nodes

Hi,

I have a tasker receive node which spits text in to a flow but every so often it outputs the following which is causing issues.

I've tried filtering out with a switch node but I can't seem to get the correct settings to stop it passing to the next node. (Plus I'm a noob at this so not entirely sure how to do this in the first place, I've just been guessing)

image

Can anyone suggest how to stop this getting passed to the next node?

This little JSONata trick may be good start.

[{"id":"1251277f.503ec9","type":"switch","z":"2cc2b60c.fb70ba","name":"","property":"payload.var","propertyType":"msg","rules":[{"t":"jsonata_exp","v":"$length($trim(payload.var)) != 0","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":1,"x":590,"y":220,"wires":[["8c3554d3.c67228"]]},{"id":"a133cd9d.678c1","type":"inject","z":"2cc2b60c.fb70ba","name":"space","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\":\"node\",\"var\":\" \"}","payloadType":"json","x":430,"y":200,"wires":[["1251277f.503ec9"]]},{"id":"8c3554d3.c67228","type":"debug","z":"2cc2b60c.fb70ba","name":"DEBUG","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":220,"wires":[]},{"id":"9265f70e.d42858","type":"inject","z":"2cc2b60c.fb70ba","name":"string with space","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"command\":\"node\",\"var\":\" m\"}","payloadType":"json","x":400,"y":240,"wires":[["1251277f.503ec9"]]}]

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