Call "Link call" from function

Is it possible to call "link call" from a function and then work with what it returns?


Thank you and take care!

Hi @S0T0

No, it is not possible to do that.

1 Like

Split the function in two and call the link in the middle.

If you really want everything in one function node (although not all in JavaScript), you could do this. Not seriously recommended.

image

[{"id":"58a0314dfaabdb02","type":"function","z":"e4d8efb5c97ba927","name":"function","func":"if (!msg._return) {\n// start function    \n// optional, if link-call has dynamic target\n// msg.target = 'subroutine'\n    msg._return = true\n    return [null,msg]\n} else {\n// finish function\n    delete msg._return\n    return[msg,null]\n}\nreturn msg;","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":320,"y":140,"wires":[["d220d81a2fe06190"],["3335886b6ff7993b"]]},{"id":"ee833ab0cd37a661","type":"inject","z":"e4d8efb5c97ba927","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":140,"wires":[["58a0314dfaabdb02"]]},{"id":"3335886b6ff7993b","type":"link call","z":"e4d8efb5c97ba927","name":"call subroutine","links":["ad7e14fffdc6f4fc"],"linkType":"static","timeout":"30","x":500,"y":160,"wires":[["a6c69fc023067e09"]]},{"id":"d220d81a2fe06190","type":"debug","z":"e4d8efb5c97ba927","name":"continue","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":480,"y":120,"wires":[]},{"id":"ad7e14fffdc6f4fc","type":"link in","z":"e4d8efb5c97ba927","name":"subroutine","links":[],"x":125,"y":220,"wires":[["b17ed7c9d1315020"]]},{"id":"d51c500e4fdb9c72","type":"link out","z":"e4d8efb5c97ba927","name":"link out 11","mode":"return","links":[],"x":335,"y":220,"wires":[]},{"id":"b17ed7c9d1315020","type":"function","z":"e4d8efb5c97ba927","name":"subroutine","func":"// subroutine code\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":230,"y":220,"wires":[["d51c500e4fdb9c72"]]},{"id":"a6c69fc023067e09","type":"junction","z":"e4d8efb5c97ba927","x":440,"y":220,"wires":[["58a0314dfaabdb02"]]}]

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