Using Switch Item to add another Items in an existing Group

Hello, I recently saw an example of lighting management with a logical approach that I had never seen before. The example illustrated a screenshot where I saw a light with its icon and status and then SWITCH items that defined whether that light belonged to the group that includes the security lights, for example, and then another that defined the light. belonging to the group of ambient lights etc. The person said that she used this information to feed the rules of lighting management. Unfortunately I lost the note that I had and for 2 days I try to trace this information. My specific question is, can I use a Switch item to place another Item in a group. The groups are already existing and are used in my rules. The goal is that instead of modifying my Items files or my Rules files whenever I want to change a scenario I could leave my rules as they are and just decide, with a switch, whether or not I want that such bulb be in such group and the following week remove it if necessary. Maybe there is an even better way to do what I want. Thank you

Perhaps you could include each Item in whatever potential groups it might be in. The, when running a rule looking for “active membership” of some group, iterate through group members ignoring those that don’t have the corresponding switch set. You’d need an Item for each 'member=yes" switch, but you need that for the UI control anyway.

I believe true dynamic group membership is a bit flakey in OH, in-flight removals do not work?

True so that why I will think twice before making the change.
Thank any way