# \[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:** 20
**Page:** 9

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [22 August 2018 13:15 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/162 "2018-08-22T13:15:56Z")

</div>

I'm giving it the full thumbs-up (once you've moved the get/set blocks 🙂 )

When you do launch - I'd start a new thread as this one has probably been muted by most people by now 🙂

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [22 August 2018 21:07 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/163 "2018-08-22T21:07:52Z")

</div>

> [@cymplecy](#):
>
> When you do launch - I'd start a new thread as this one has probably been muted by most people by now

Indeed. I already planned to create a new thread when I publish it on NPM. But do you really think that the entire Node-RED community is currently neutralized, and nobody is following this discussion anymore? There is only one way to check whether you are right: anybody that adds a like ♥ to this post within 24 hours, will get a free bottle of champagne from Simon!

> [@cymplecy](#):
>
> I'm giving it the full thumbs-up (once you've moved the get/set blocks

Deal! On Github you can find a new version with following changes:

- The property-get/set blocks have been **moved** from the 'Object' category in the toolbox to the 'Node-RED' category:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e104411b857efd0f077170a03114b1c3a2690624.png)

- I installed the awesome Node-RED **0.19 version** , but seemed that I had forgotton to update my sandbox code to offer the new node.id and node.name properties in the limited API. But that is now solved:  

If this is fine for everybody, I will restart my documentation work ....

Bart

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [22 August 2018 21:11 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/164 "2018-08-22T21:11:49Z")

</div>

> [@BartButenaers](#):
>
> There is only one way to check whether you are right: anybody that adds a like ♥ to this post within 24 hours, will get a free bottle of champagne from Simon!

Seems reasonable to me 🙂

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [22 August 2018 21:18 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/165 "2018-08-22T21:18:01Z")

</div>

PS new one works (once I'd done the global search/replace on the flow.json) so you are still good to go 🙂

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [22 August 2018 21:32 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/166 "2018-08-22T21:32:02Z")

</div>

A very very very small suggestion when you publish to NPM

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c99054ef0983ff3cb38e66ae0e457b7d63349d95.png)

maybe should have a default text block instead of being empty

Would help users work out which block goes from JSON to JS object and which goes from JS Object to JSON

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [22 August 2018 21:44 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/167 "2018-08-22T21:44:05Z")

</div>

I created last week already a series of **tutorials** on my [wiki](https://github.com/bartbutenaers/node-red-contrib-blockly/wiki) page. Keep in mind that this is currently in **DRAFT** status:

- Extra tutorials need to be added
- Some of the tutorials are already obsolete, due to my developments in the last week.
- A table of content page need to be added
- ...

Would like to have some feedback about the **animated gifs** : they are very useful to explain to a novice user how to drag and drop the blocks to his editor. However you cannot pause them, or go back to the start ... It is even not visible whether you are at the beginning, or in the middle of the movie ... And perhaps it is annoying for some users to have all the movements on the screen. Some random thoughts:

- Is it better to show a real movie, like the Node-RED version 0.19 movie from @knolleary . If yes (?) how to record the screen, where to store the movies (on Github wiki?), how to show them in the wiki? ...
- Or just show a screenshot of the blocks, and add e.g. a button to open the animated gif in a new browser window? Then you can determine when the animated gif needs to start.
- others ???

Just want to avoid that I spend a lot of spare time to the documentation, and everybody thinks it is complete rubbish ...

---

<div class="post-metadata">

### Author: ![tilleul](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tilleul/32/78_2.png) [@tilleul](https://discourse.nodered.org/u/tilleul)
#### Post date: [22 August 2018 21:47 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/168 "2018-08-22T21:47:15Z")

</div>

@BartButenaers I added a ❤ to your post within 24 hours ... I'm gonna need that bottle of champagne you've been talking about ... the good news is that I'm in Belgium too so shipping won't cost you too much 🙂 ... just kidding ... just wanted to post to say that "other" people are following your "experiments" without necessarily being active on this post .... this looks promising, keep up the good work !

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [22 August 2018 21:50 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/169 "2018-08-22T21:50:46Z")

</div>

I don't normally EVER watch a video but I will watch a gif because they are normally short and to the point. So I like your GIFs when they are short

I do post vids myself 🙂 on Youtube and then link to them on twitter so if your going to do videos then I'd embed youtube videos (if you can)

Keep the number of images/gifs/videos down as you WILL have to update them again

Try to keep them simple and without extra annotation

I will do a series of tutorials from beginners point of view and show how flows with several standard nodes can be compressed into a single blocky node. I'll fork your wiki and do pull requests 🙂

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [22 August 2018 21:51 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/170 "2018-08-22T21:51:32Z")

</div>

> [@tilleul](#):
>
> the good news is that I'm in Belgium too so shipping won't cost you too much

its me that is buying and I live in UK ☹

---

<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: [22 August 2018 23:27 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/171 "2018-08-22T23:27:56Z")

</div>

> [@BartButenaers](#):
>
> Would like to have some feedback about the **animated gifs**

They look OK to me, not too fast which is when they get really annoying.

> [@BartButenaers](#):
>
> Is it better to show a real movie,

Personally, I'd stick with what you've got for now. If you wanted to do a video, maybe come up wth a nice example to create. But you don't have to answer every question just to publish a first version. People will expect some limitations on first release. Better to get it out now so that others can find issues, make suggestions and ask for help (so you know where you may have documentation gaps or need a vid).

---

<div class="post-metadata">

### Author: ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)
#### Post date: [23 August 2018 10:56 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/172 "2018-08-23T10:56:57Z")

</div>

> [@TotallyInformation](#):
>
> But you don't have to answer every question just to publish a first version.

Yes I know that it's very tempting for me to develop years on version 1, until it contains all functionality (e.g. launch rockets to other solar systems...). But about the new version from yesterday: it contained _ **breaking changes** _, so I would damage all existing flows. That kind of stuff needs to be in my first version!

I will start writing documentation again this evening, to make sure that I don't develop anything new 🤨

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 August 2018 11:32 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/173 "2018-08-23T11:32:33Z")

</div>

[issue]  
I was expecting this to count up from 1 to 5 but it jumped instead

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/50887c7df2b67467b17ca6e940e28e07a5d77fdb.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/570aa05e0c26416e84d5ee1cb3579a651e8a82c3.png)

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 August 2018 12:31 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/174 "2018-08-23T12:31:18Z")

</div>

Thought about this and began to think that it may be fundemental to Node-RED

Did a bit of googleing and found this  
[http://noderedguide.com/node-red-lecture-5-the-node-red-programming-model/#h.n0q1bv7ofyil](http://noderedguide.com/node-red-lecture-5-the-node-red-programming-model/#h.n0q1bv7ofyil)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7f720cbeb8b2a0e694cd4b0f5222ebfbd9f78f3f.png)

which I managed to translate to this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/846eb4e2ae4b17f6fdc5a9f1c25fbbb14ccccaeb.png)

which works 🙂

ONCE THE PROJECT IS LAUNCHED ON NPM AND NOT BEFOREHAND I think it would be nice to have a list block to match `msgList.push({payload:i});` i.e the .push bit 🙂

---

<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: [23 August 2018 13:18 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/175 "2018-08-23T13:18:33Z")

</div>

> [@cymplecy](#):
>
> I was expecting this to count up from 1 to 5 but it jumped instead

Not for me it didn't!

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b02e97ca7bbd46429347bc28a05fe25d279e04bf.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5eca58e7c2f5487d00e54749fcbb716e657a2a90.png)

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 August 2018 13:20 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/176 "2018-08-23T13:20:43Z")

</div>

I'll make a smal wager that you don't have the rate limiter in your flow 🙂

---

<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: [23 August 2018 13:20 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/177 "2018-08-23T13:20:51Z")

</div>

> [@cymplecy](#):
>
> ONCE THE PROJECT IS LAUNCHED ON NPM AND NOT BEFOREHAND I think it would be nice to have a list block to match `msgList.push({payload:i});` i.e the .push bit 🙂

Don't think that is needed.

However, a nice enhancement would be a generic list "push", "pop" blocks.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 August 2018 13:22 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/178 "2018-08-23T13:22:16Z")

</div>

Thats what I meant - generic block not specfic for this task

---

<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: [23 August 2018 13:24 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/179 "2018-08-23T13:24:04Z")

</div>

> [@cymplecy](#):
>
> I'll make a smal wager that you don't have the rate limiter in your flow

Ah, well of course that would jump since a simple loop will execute in a fraction of a second!

The problem is that the msg object is being reused - this is a JavaScript issue, not a Node-RED one.

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [23 August 2018 13:26 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/180 "2018-08-23T13:26:47Z")

</div>

> [@TotallyInformation](#):
>
> this is a JavaScript issue

Thought it might be something like that - I really struggle, at times, to get my head around the non-sequential behaviour of JS

But JS programmers will have it made when quantum computing takes off 🙂

---

<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: [23 August 2018 13:27 UTC](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566/181 "2018-08-23T13:27:14Z")

</div>

This is the code that should be being used:

```javascript
for (i = 1; i <= 5; i++) {
  var msg1 = {'payload': i};
  node.send([msg1]);
}

```

Note the inner use of `var` which ensures that each msg is unique.

If you wanted to make sure that each msg inherited the incoming msg, you would need to do a deep copy of the `msg` object. There is a utility function for that attached to the `RED` object.

[Previous page](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566.md?page=8)

[Next page](https://discourse.nodered.org/t/announce-visual-programming-a-function-node-with-blockly-feedback-request/1566.md?page=10)
