This recipe allows you to show only certain groups in a group selector drop down, such as a "In Group(s)" filter on a dynamic report. The end result is something like this, where only the groups you want displayed are shown. This recipe can only be applied in places with a "Pre-HTML" field available.

Annotation 2020-03-05 110110.jpg

There are two ways of obtaining these results, you can hide certain groups or hide all but certain groups. Follow the corresponding instructions depending on what your needs are:

Hiding Certain Groups

In the Pre-HTML field of wherever the Group Selector appears, add the following code:

<style type="text/css">
.rocktree li[data-id="100"],
.rocktree li[data-id="115"],
.rocktree li[data-id="123"]
{
display: none;
}
</style>

Replacing "100", "115", and "123" with the Group-ID of the group(s) you want hidden. Feel free to add or remove additional lines to hide as many or as few groups as you want. Make sure that each line ends with a "," (comma) except the last line.

Hiding All Groups Except Certain Groups

In the Pre-HTML field of wherever the Group Selector appears, add the following code:

<style type="text/css">
.rocktree li
{ display: none; } .rocktree li[data-id="100"],
.rocktree li[data-id="115"],
.rocktree li[data-id="123"]
{ display: initial; } </style>

This time replacing "100", "115", and "123" with the Group-Id of group(s) you want shown. Feel free to add or remove additional lines to show as many or as few groups as you want. Make sure that each line ends with a "," (comma) except the last line.

How to Find Group-ID

You can find the Group-ID in the URL when you are viewing the group in a group-tree. For example, the URL could be /page/118?GroupId=214&ExpandedIds=56%2C211247 so the corresponding line of HTML would be .rocktree li[data-id="214"].