1
00:00:00,630 --> 00:00:06,330
In this lecture, I'll show you how you can use the node groups feature in Node Red.

2
00:00:07,260 --> 00:00:10,780
This allows you to group together one or more notes.

3
00:00:11,110 --> 00:00:12,920
You can give a group a name.

4
00:00:12,930 --> 00:00:19,770
You can copy a group and therefore copy all of the notes inside of it and use it in other flows and

5
00:00:19,770 --> 00:00:20,370
so on.

6
00:00:21,180 --> 00:00:31,320
Groups have existed in note since version 1.1.0, but also in no division two and onwards.

7
00:00:31,560 --> 00:00:36,870
Groups have been given the ability to also have their own environment variable set.

8
00:00:37,320 --> 00:00:42,900
And I'm going to show you how to use environment variables in a separate lecture in Section 18.

9
00:00:43,470 --> 00:00:49,590
So to get the details of what I'm about to show you, you can go to the documentations user groups,

10
00:00:49,590 --> 00:00:55,230
ED Workspace groups, and there's quite a bit of information here, but I just want to show you an example

11
00:00:55,230 --> 00:00:56,400
of how groups work.

12
00:00:56,850 --> 00:01:05,640
So I've got a very simple flow here, just an inject note to trigger everything that follows after that.

13
00:01:06,000 --> 00:01:11,190
And I've got a couple of notes here that do something very simple.

14
00:01:11,190 --> 00:01:20,520
The the change node will just set the payload or whatever comes out of this particular mode to an example

15
00:01:20,700 --> 00:01:29,340
message which have been set earlier in the inject note here you can see a sample message is set to just

16
00:01:29,340 --> 00:01:32,820
some fixed text, nothing fancy here.

17
00:01:33,300 --> 00:01:39,510
But what I want to show you is that I can actually do a multiple select with my mouse and then go to

18
00:01:39,510 --> 00:01:41,430
the menu up here.

19
00:01:41,430 --> 00:01:43,800
Groups and group selection like that.

20
00:01:44,250 --> 00:01:46,710
Now I've got a note group.

21
00:01:47,160 --> 00:01:54,720
I can get the properties of this group and set those properties by double clicking on the group border.

22
00:01:54,930 --> 00:01:57,540
And then I can give this group a name.

23
00:01:58,530 --> 00:02:06,180
And example group set a color for the outline feel.

24
00:02:07,930 --> 00:02:10,390
It's part of transparency.

25
00:02:10,690 --> 00:02:16,090
And I'm going to show the label at the top left corner of the books here.

26
00:02:16,090 --> 00:02:16,630
Okay.

27
00:02:16,640 --> 00:02:19,210
And you can see what the effect is of what I've just done.

28
00:02:20,360 --> 00:02:21,770
Of course it is cosmetic.

29
00:02:22,100 --> 00:02:24,440
A very interesting new feature in.

30
00:02:24,710 --> 00:02:27,120
No threat to the environment variables.

31
00:02:27,170 --> 00:02:29,900
I'm going to leave this aside for now and show you how to do that.

32
00:02:30,050 --> 00:02:32,150
As I said in a separate lecture coming up.

33
00:02:32,540 --> 00:02:37,640
But you can also have a description set specifically for this node.

34
00:02:37,670 --> 00:02:44,990
So I can just say here, this is just an example.

35
00:02:46,370 --> 00:02:54,290
New group, something simple that explains to whoever is looking at your flow and this particular group

36
00:02:54,290 --> 00:02:56,300
what this group is supposed to do.

37
00:02:57,530 --> 00:03:00,290
Another nice thing about groups, of course, is convenience.

38
00:03:00,320 --> 00:03:07,350
So let's say that I want to make a copy of the notes and their associations inside this group.

39
00:03:07,370 --> 00:03:14,990
I can just select the group first and then do a command C and command V or control C, control V and

40
00:03:14,990 --> 00:03:17,420
have an exact copy of this group.

41
00:03:18,140 --> 00:03:24,620
And of course, for a simple flow like this one, a group is not a big deal.

42
00:03:24,920 --> 00:03:27,310
You don't have much complexity to worry about.

43
00:03:27,320 --> 00:03:33,830
But if you have something more complex like this, then having the ability to create groups becomes

44
00:03:34,010 --> 00:03:35,390
a lot more important.

45
00:03:35,780 --> 00:03:41,330
So for example, I can go and say that I'd like to see be more specific.

46
00:03:41,960 --> 00:03:48,500
I like to have these items these know selected into a group.

47
00:03:51,130 --> 00:03:51,610
Done.

48
00:03:51,800 --> 00:03:54,730
Then I can move all of those items in one go.

49
00:03:55,480 --> 00:03:57,490
Just move those up a little higher.

50
00:03:58,620 --> 00:03:59,790
Rearrange things.

51
00:04:01,600 --> 00:04:02,290
Name it.

52
00:04:07,140 --> 00:04:08,940
Set the various parameters.

53
00:04:10,640 --> 00:04:13,340
And of course, a quick copy.

54
00:04:15,540 --> 00:04:22,680
Of the entire group like that to UN group, the items in a group are to select the group.

55
00:04:22,840 --> 00:04:25,950
But back to the menu groups and on group.

56
00:04:27,280 --> 00:04:33,770
And that's it about groups is just a simple way to group together multiple nodes.

57
00:04:34,180 --> 00:04:39,580
If you're interested in learning how to use environmental diagnoses, start a group and have a look

58
00:04:39,580 --> 00:04:42,340
at the relevant lecture in Section 18.
