# \[ANNOUNCE\] Visual programming a function node with Blockly - Feedback request

**URL:** <https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566>\
**Category:** Share Your Nodes\
**Created:** [13 July 2018 22:33 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566 "2018-07-13T22:33:30Z")\
**Posts on this page:** 1\
**Showing post:** 146

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 August 2018 21:42 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/146 "2018-08-17T21:42:38Z")

</div>

> [@BartButenaers](#):
>
> Belgian beers

Nice. Though the consumption of scotch on this end may not add clarity to my melted brain output!

> [@BartButenaers](#):
>
> This is not what I want, so I want to get back to the first version (with the numeric input field). That works fine and the user can also do some advanced stuff with it.

Right, so why not have an outputNumber block that can only be 1 to the number set? Once the user has set the number of outputs and blurred away from the input, it is available to you (as the node author) via JQuery. Now you've eliminated one of your potential errors. The user of the node cannot select an invalid output node number. Doesn't that help? Certainly would make it easier for novice users I think?

> [@BartButenaers](#):
>
> Now it is your turn to give an example of what you mean ...

OK, I re-read your code and it seems as though the scotch _is_ actually helping because I can see that you are using template literal features in some cases (e.g. embeded variables that you want evaluated inside the string). But not in other cases. I'm a little anal about such things and I would use simple strings unless I needed something more.

Your code:

```javascript
    var code = `if(${functionName}(${outputNumber})) {\n`;
    code += ` node.send([${outputArray}]);\n`;
    code += `}\n`;

```

My anal code:

```javascript
    var code = `if(${functionName}(${outputNumber})) {\n`;
    code += ` node.send([${outputArray}]);\n`;
    code += "}\n";

```

The other potential problem back-ticks AKA "[Template Literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)" is that they are very new feature in JavaScript and likely wont work for one of those hangouts using an old version of Node.JS - it was first introduced into the JS spec in 2016 I think. Not sure what version of Node.JS it was implemented. However, people should be using at least Node v8.x which does support them so that shouldn't be an issue.

Just ignore me.

---

_[View the full topic](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566)._
