{"__v":4,"_id":"566f5879fc3abb0d0020fccd","category":{"__v":37,"_id":"566f5361c1b00f1900ffd49f","pages":["566f57efe61c1917005aa485","566f57f9fc3abb0d0020fcc7","566f5801c1b00f1900ffd4ad","566f580b7ffa002300c3cdb1","566f5817fc3abb0d0020fcc9","566f582ee144ab0d00e972f3","566f5834fc3abb0d0020fccb","566f5845de4b662100d60eb2","566f5855e144ab0d00e972f5","566f5866e144ab0d00e972f7","566f5870de4b662100d60eb4","566f5879fc3abb0d0020fccd","566f588dde4b662100d60eb6","566f5894de4b662100d60eb8","566f589ffc3abb0d0020fccf","566f58aae144ab0d00e972f9","566f58bb7ffa002300c3cdb3","566f58c67ffa002300c3cdb5","566f58d046acce17000c8c8e","566f58d9e144ab0d00e972fb","566f58e4de4b662100d60eba","566f58ede61c1917005aa488","566f58f746acce17000c8c90","566f5903e144ab0d00e972fd","566f590bfc3abb0d0020fcd1","566f592dfc3abb0d0020fcd3","566f593546acce17000c8c92","566f5942c1b00f1900ffd4af","566f594c46acce17000c8c94","566f5965e144ab0d00e972ff","566f597bde4b662100d60ebc","566f5986e61c1917005aa48a","566f5991de4b662100d60ebe","566f599ae144ab0d00e97301","566f59a5de4b662100d60ec0","566f5b3e7ffa002300c3cdbb","56ec52cb611730190000f246"],"project":"566f5337c1b00f1900ffd497","version":"566f5337c1b00f1900ffd49a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-14T23:40:17.953Z","from_sync":false,"order":1,"slug":"operators","title":"Tools"},"parentDoc":null,"project":"566f5337c1b00f1900ffd497","user":"5564f227f0f70f0d00a9ab20","version":{"__v":6,"_id":"566f5337c1b00f1900ffd49a","project":"566f5337c1b00f1900ffd497","createdAt":"2015-12-14T23:39:35.821Z","releaseDate":"2015-12-14T23:39:35.821Z","categories":["566f5338c1b00f1900ffd49b","566f535bc1b00f1900ffd49e","566f5361c1b00f1900ffd49f","566f537ae144ab0d00e972de","56706d21e10ecb0d0004ef4f","567af36193919f0d00c97a6f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-15T00:02:01.572Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":11,"body":"The Function node allows you to add JavaScript within your flow. The function node has access to the {msg} object from the previous node and anything it returns will pass along as the {msg} object.\n\nThe function node also supports:\n\n- [Lodash](http://lodash.com/docs)\n- MomentJS\n\nFor Example:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/W4AKuup7RGGlgFtFttRY_Screen%20Shot%202015-12-15%20at%2011.59.21%20AM.png\",\n        \"Screen Shot 2015-12-15 at 11.59.21 AM.png\",\n        \"433\",\n        \"137\",\n        \"#0e6fa7\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nWill send this message to the next node.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ZHb6onGtQ0C1d7er9jxy_Screen%20Shot%202015-12-15%20at%2011.59.27%20AM.png\",\n        \"Screen Shot 2015-12-15 at 11.59.27 AM.png\",\n        \"337\",\n        \"141\",\n        \"#5aa242\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou can even use MomentJS within the function node!\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/RhYiykFsROSwV7DYjS3w_Screen%20Shot%202015-12-15%20at%2011.59.34%20AM.png\",\n        \"Screen Shot 2015-12-15 at 11.59.34 AM.png\",\n        \"355\",\n        \"235\",\n        \"#a43696\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nOr use conditionals and much more!\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ArY6wz2T2WlN5C1gyb7w_Screen%20Shot%202015-12-15%20at%2011.59.42%20AM.png\",\n        \"Screen Shot 2015-12-15 at 11.59.42 AM.png\",\n        \"353\",\n        \"244\",\n        \"#b050a2\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n## Sample Flows\n\n[https://app.octoblu.com/bluprints/import/aef6c835-e01f-42bc-addb-9a136712d54f](https://app.octoblu.com/bluprints/import/aef6c835-e01f-42bc-addb-9a136712d54f)","excerpt":"","slug":"function","type":"basic","title":"Function"}
The Function node allows you to add JavaScript within your flow. The function node has access to the {msg} object from the previous node and anything it returns will pass along as the {msg} object. The function node also supports: - [Lodash](http://lodash.com/docs) - MomentJS For Example: [block:image] { "images": [ { "image": [ "https://files.readme.io/W4AKuup7RGGlgFtFttRY_Screen%20Shot%202015-12-15%20at%2011.59.21%20AM.png", "Screen Shot 2015-12-15 at 11.59.21 AM.png", "433", "137", "#0e6fa7", "" ] } ] } [/block] Will send this message to the next node. [block:image] { "images": [ { "image": [ "https://files.readme.io/ZHb6onGtQ0C1d7er9jxy_Screen%20Shot%202015-12-15%20at%2011.59.27%20AM.png", "Screen Shot 2015-12-15 at 11.59.27 AM.png", "337", "141", "#5aa242", "" ] } ] } [/block] You can even use MomentJS within the function node! [block:image] { "images": [ { "image": [ "https://files.readme.io/RhYiykFsROSwV7DYjS3w_Screen%20Shot%202015-12-15%20at%2011.59.34%20AM.png", "Screen Shot 2015-12-15 at 11.59.34 AM.png", "355", "235", "#a43696", "" ] } ] } [/block] Or use conditionals and much more! [block:image] { "images": [ { "image": [ "https://files.readme.io/ArY6wz2T2WlN5C1gyb7w_Screen%20Shot%202015-12-15%20at%2011.59.42%20AM.png", "Screen Shot 2015-12-15 at 11.59.42 AM.png", "353", "244", "#b050a2", "" ] } ] } [/block] ## Sample Flows [https://app.octoblu.com/bluprints/import/aef6c835-e01f-42bc-addb-9a136712d54f](https://app.octoblu.com/bluprints/import/aef6c835-e01f-42bc-addb-9a136712d54f)