How to create an empty context object

It may have been nearly understandable but it was wrong!

This is the one that works properly :slight_smile:

And of course, doesn't work in my real flow! :frowning:
image

Simon, you don't need the "$not", just swap both sides of the ":" operator.
$flowContext("homemadeSub") : {}

Of course I don't - I stuck it in my original faulty version

it's still not working in my real flow though :frowning:

Works for me:

[{"id":"3280794c.eb6396","type":"change","z":"9a769d3cc79cd9e4","name":"","rules":[{"t":"set","p":"homemadeSub","pt":"flow","to":"$exists($flowContext(\"homemadeSub\")) ?  $flowContext(\"homemadeSub\") : {}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":100,"wires":[["10a54176.da8daf"]]}]

Screenshot_2023-10-26_14-48-40

1 Like

And of course, yours works for me as well :slight_smile:

When I'm really bored - I'll try and work out what the difference is between yours and mine :slight_smile:

[{"id":"bd75de939b96d814","type":"change","z":"f7546f055375d300","name":"BROKEN","rules":[{"t":"set","p":"homemadeSub","pt":"flow","to":"$exists($flowContext(\"homemadeSub\")) ? $flowContex(\"homemadeSub\") : {}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":760,"wires":[["10a54176.da8daf"]]},{"id":"ab01324c.4824","type":"inject","z":"f7546f055375d300","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":540,"y":760,"wires":[["bd75de939b96d814"]]},{"id":"10a54176.da8daf","type":"debug","z":"f7546f055375d300","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":950,"y":760,"wires":[]}]
1 Like

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