In this lecture, I'll show you how you can use the node groups feature in Node Red.
This allows you to group together one or more notes.
You can give a group a name.
You can copy a group and therefore copy all of the notes inside of it and use it in other flows and
so on.
Groups have existed in note since version 1.1.0, but also in no division two and onwards.
Groups have been given the ability to also have their own environment variable set.
And I'm going to show you how to use environment variables in a separate lecture in Section 18.
So to get the details of what I'm about to show you, you can go to the documentations user groups,
ED Workspace groups, and there's quite a bit of information here, but I just want to show you an example
of how groups work.
So I've got a very simple flow here, just an inject note to trigger everything that follows after that.
And I've got a couple of notes here that do something very simple.
The the change node will just set the payload or whatever comes out of this particular mode to an example
message which have been set earlier in the inject note here you can see a sample message is set to just
some fixed text, nothing fancy here.
But what I want to show you is that I can actually do a multiple select with my mouse and then go to
the menu up here.
Groups and group selection like that.
Now I've got a note group.
I can get the properties of this group and set those properties by double clicking on the group border.
And then I can give this group a name.
And example group set a color for the outline feel.
It's part of transparency.
And I'm going to show the label at the top left corner of the books here.
Okay.
And you can see what the effect is of what I've just done.
Of course it is cosmetic.
A very interesting new feature in.
No threat to the environment variables.
I'm going to leave this aside for now and show you how to do that.
As I said in a separate lecture coming up.
But you can also have a description set specifically for this node.
So I can just say here, this is just an example.
New group, something simple that explains to whoever is looking at your flow and this particular group
what this group is supposed to do.
Another nice thing about groups, of course, is convenience.
So let's say that I want to make a copy of the notes and their associations inside this group.
I can just select the group first and then do a command C and command V or control C, control V and
have an exact copy of this group.
And of course, for a simple flow like this one, a group is not a big deal.
You don't have much complexity to worry about.
But if you have something more complex like this, then having the ability to create groups becomes
a lot more important.
So for example, I can go and say that I'd like to see be more specific.
I like to have these items these know selected into a group.
Done.
Then I can move all of those items in one go.
Just move those up a little higher.
Rearrange things.
Name it.
Set the various parameters.
And of course, a quick copy.
Of the entire group like that to UN group, the items in a group are to select the group.
But back to the menu groups and on group.
And that's it about groups is just a simple way to group together multiple nodes.
If you're interested in learning how to use environmental diagnoses, start a group and have a look
at the relevant lecture in Section 18.