# Hiding group using "ui\_control" node and "button"

**URL:** <https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567>\
**Category:** Dashboard\
**Created:** [3 March 2019 18:53 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567 "2019-03-03T18:53:50Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpaolojo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cpaolojo](https://discourse.nodered.org/u/cpaolojo)\
**Post date:** [3 March 2019 18:53 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/1 "2019-03-03T18:53:50Z")

</div>

Hi all,  
I would hide group in my dashboard. I've tried all the solution which I've found in the forum but it still doesn't work.  
I have a "button" node which sends a JSON message to the "ui\_control" node.  
The problem probably is the format of the JSON message.I've tried the following format:

`{group:{hide:["tab_name_group_name_with_underscores"],show:["tab_name_another_group"],focus:true}}`  
and  
`{"group":{"hide":["Tab1_Group_1"]}}`  
and also  
`{tab:“tab_name_with_underscores”,group:{hide:“group_name_with_underscores”,show:“group_name_with_underscores”,focus:true}}`  
but no one works.  
I also tried the flow in  
[https://flows.nodered.org/flow/f1b077d49f52866e74e9b983690b470f](https://flows.nodered.org/flow/f1b077d49f52866e74e9b983690b470f)  
but I had no results.  
Could you help me?  
Thanks a lot  
Paolo

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [3 March 2019 19:13 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/2 "2019-03-03T19:13:35Z")

</div>

If the example you linked to doesn’t work, have you checked which version of Node-RED, nodejs & node-red-dashboard you are using?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 March 2019 21:54 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/3 "2019-03-03T21:54:12Z")

</div>

So what are YOUR tabs called ? the examples above are purely examples - you need to use your tab names and group names (but replace any spaces with underscores - so Tab 1 Group 1 would be Tab\_1\_Group\_1 - also that is a slightly old example in that it was for using in a function node - for any other node you need correctly formatted json - so for example

```
{"group":{"hide":["your_tab_your_group"]}}

```

(note the extra " around the property names. )

---

<div class="post-metadata">

**Author:** ![cpaolojo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cpaolojo](https://discourse.nodered.org/u/cpaolojo)\
**Post date:** [4 March 2019 09:34 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/4 "2019-03-04T09:34:09Z")

</div>

Thanks guys for tour replys.  
The version of node Red installed in my Raspberry Is 0.18.3.  
The name of the tab Is "testgroup" and the groups name are "uno" "due", "tre". So, I've tried the following:

'{"testgroup":{"hide":["testgroup\_uno"]}}'  
But It doesn t work.  
Ant idea?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 March 2019 09:51 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/5 "2019-03-04T09:51:17Z")

</div>

Your syntax is not quite correct it needs to be

```
 {"groups":{"hide":["testgroup_uno"]}}

```

Here is an example

```auto
[{"id":"9129737d.60fcb","type":"inject","z":"db8bd33.4e7c83","name":"","topic":"","payload":"{\"group\":{\"hide\":[\"testgroup_uno\"]}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":340,"wires":[["da87bbb8.d2bfb8"]]},{"id":"da87bbb8.d2bfb8","type":"ui_ui_control","z":"db8bd33.4e7c83","name":"","x":380,"y":380,"wires":[[]]}]

```

Hiding groups was only added in 2.9.4 or more recent version of dashboard so I assume you have that (the version is printed in the console wen you start Node-RED).

---

<div class="post-metadata">

**Author:** ![cpaolojo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cpaolojo](https://discourse.nodered.org/u/cpaolojo)\
**Post date:** [4 March 2019 13:21 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/6 "2019-03-04T13:21:04Z")

</div>

Could You explain me Better how can I get the version of node red installed on my Raspberry?when i start the consolle i can't see the version..Sorry.  
Thanks a lot  
Paolo

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 March 2019 13:40 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/7 "2019-03-04T13:40:23Z")

</div>

if you run `node-red-stop && node-red-start` in a console it will stop and start Node-RED and show you the versions.

---

<div class="post-metadata">

**Author:** ![cpaolojo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cpaolojo](https://discourse.nodered.org/u/cpaolojo)\
**Post date:** [4 March 2019 15:03 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/8 "2019-03-04T15:03:55Z")

</div>

Thanks a lot dceejay. I've tried your code but it still doesn't work.  
Here follow the node red version in my raspberry and also the entire flow which doesn't work.

**Node red version**  
Node-RED version: v0.19.6  
Node.js version: v10.15.2  
Linux 4.14.98+ arm LE  
Dashboard version 2.8.1 started at /ui

**My flow**  
`[{"id":"f5ef31ed.9dab7","type":"tab","label":"groupTEST","disabled":false,"info":""},{"id":"67fe18ba.e61688","type":"ui_text","z":"f5ef31ed.9dab7","group":"256ee50c.7774da","order":0,"width":0,"height":0,"name":"","label":"","format":"due","layout":"row-spread","x":570.8945503234863,"y":191.75390911102295,"wires":[]},{"id":"9a9b17e7.db7b88","type":"ui_text","z":"f5ef31ed.9dab7","group":"a20dc40b.fb1808","order":0,"width":0,"height":0,"name":"","label":"","format":"tre","layout":"row-spread","x":576.0195503234863,"y":245.00391292572021,"wires":[]},{"id":"988a6e81.2b276","type":"inject","z":"f5ef31ed.9dab7","name":"","topic":"","payload":"{\"group\":{\"hide\":[\"testgroup_uno\"]}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":421.69560623168945,"y":298.35070610046387,"wires":[["3b08c4c7.96a06c"]]},{"id":"3b08c4c7.96a06c","type":"ui_ui_control","z":"f5ef31ed.9dab7","name":"","x":583.362232208252,"y":300.0173897743225,"wires":[[]]},{"id":"b123fd52.5b5f5","type":"ui_text","z":"f5ef31ed.9dab7","group":"e099ab9b.c78f48","order":0,"width":0,"height":0,"name":"","label":"","format":"uno","layout":"row-spread","x":573.3622436523438,"y":135.01734924316406,"wires":[]},{"id":"256ee50c.7774da","type":"ui_group","z":"","name":"due","tab":"6d74c650.0fe308","order":2,"disp":true,"width":"6","collapse":false},{"id":"a20dc40b.fb1808","type":"ui_group","z":"","name":"tre","tab":"6d74c650.0fe308","order":3,"disp":true,"width":"6","collapse":false},{"id":"e099ab9b.c78f48","type":"ui_group","z":"","name":"uno","tab":"6d74c650.0fe308","order":1,"disp":true,"width":"6","collapse":false},{"id":"6d74c650.0fe308","type":"ui_tab","z":"","name":"testgroup","icon":"dashboard","order":35}]`

could you help me?  
Thanks a lot

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [4 March 2019 15:07 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/9 "2019-03-04T15:07:01Z")

</div>

As @dceejay says you need v2.9.4+ of dashboard

You say you have Dashboard version 2.8.1

you need to upgrade

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [4 March 2019 15:12 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/10 "2019-03-04T15:12:14Z")

</div>

to upgrade dashboard on PI

```
cd ~/.node-red
npm i node-red-dashboard@latest
node-red-stop && node-red-start
```

---

<div class="post-metadata">

**Author:** ![cpaolojo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cpaolojo](https://discourse.nodered.org/u/cpaolojo)\
**Post date:** [4 March 2019 19:06 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/11 "2019-03-04T19:06:49Z")

</div>

Fantastic!now It works.  
Thanks a lot all my Friends

---

<div class="post-metadata">

**Author:** ![cpaolojo](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@cpaolojo](https://discourse.nodered.org/u/cpaolojo)\
**Post date:** [6 March 2019 13:55 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/12 "2019-03-06T13:55:56Z")

</div>

Hi all, i have another question for you!  
Now i'm able to hide/show group by sending a JSON message from "button"/"inject" node to "ui\_control" node.  
Now I would hide/show a group sending a message from a "function" node to "ui\_control" node.  
The question is: have I to use also in this case the JASON format for the message? Or could I use a "standard" format?  
Thanks a lot  
Paolo

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [6 March 2019 18:36 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/13 "2019-03-06T18:36:22Z")

</div>

What have you tried?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [6 March 2019 21:35 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/14 "2019-03-06T21:35:40Z")

</div>

You need to send the same message to create the same effect.

---

<div class="post-metadata">

**Author:** ![Zhuhan](https://avatars.discourse-cdn.com/v4/letter/z/a183cd/32.png) [@Zhuhan](https://discourse.nodered.org/u/Zhuhan)\
**Post date:** [12 May 2020 19:49 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/15 "2020-05-12T19:49:40Z")

</div>

Hello guys!  
my question is how many groups can you hide/ operate at once? I have my group 1-3 working fine, but when i add a button to control group4, the button just stop working like any others for previous groups? Any thoughts?

---

<div class="post-metadata">

**Author:** ![quebecsti](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/quebecsti/32/38757_2.png) [@quebecsti](https://discourse.nodered.org/u/quebecsti)\
**Post date:** [13 March 2021 13:19 UTC](https://discourse.nodered.org/t/hiding-group-using-ui-control-node-and-button/8567/16 "2021-03-13T13:19:47Z")

</div>

Thanks!!! I had the same problem and you solved it!
