Quite frequently, I have a couple of placeholders or more that share the same logic. Of course, the value (or the output, or the "show"/"don't show") of the placeholders may vary, but they share the same "when" conditions. Grouping these placeholders allow me to set their logic and later edit it together, in one place. This means my implementation is quicker (because I only set the conditions once), safer (fewer chances to make a mistake in one of the placeholders) and easier to maintain.
In the example below, I'm building a Contact Agent scene (image 1). The goal of this scene is to provide the contact details of a real estate agent. There are several potential contact methods - I'd like to display the agent's email if possible (and if it's a valid Sky Real Estate email), then the phone (if it's a valid phone number), and in case both of these contact methods are not available (missing from the feed or invalid) - displays the agent's Facebook Messenger.
So I create the two placeholders (contactIcon and contactText - image 2), and define the logic in one of them (the text placeholders - image 3). In the left-side panel, I click on one of the placeholders, hold down the "ctrl" button, and click on the other placeholder - both placeholders are selected (image 4). Right-click and "Group" (image 5) opens a Create New Group dialogue (image 6). I name the group and choose to use the logic that I've already defined for the contactText placeholder - and that's it. Now I don't have to re-define the conditions for the contactIcon image placeholders - just select the icons (image 7).
- Select multiple placeholders by holding down the Ctrl key (or command in mac) while selecting
- Right-click → Group
- Name the group and choose whether you'd like to use the existing logic of one of the placeholders or write the logic from scratch
The first click on a grouped placeholder will select the entire group. Actions you can perform on the entire group from the right-click context menu (image 8):
- Rename - to rename the group
- Ungroup - to break down the group. The placeholders will retain the groups logic (all the "when" conditions, just the relevant "show" values)
- Delete - this will delete the group as well as all the placeholders that are part of the group
The second click on that placeholder will select just the placeholder. The right-panel stays the same - once a placeholder is part of the group, you cannot edit it individually (until you remove it from the group). However, on the left panel, you can move and resize it (the group borders will adjust accordingly), and perform the following actions from the right-click context menu (image 9):
- Rename - to rename the selected placeholder
- Remove from Group - to remove the selected placeholder from the group. The placeholders will retain the group's logic (all the "when" conditions, just the relevant "show" values). The rest of the group will stay the same unless there is only one additional placeholder in the group - in which case the group will be removed
- Delete - to delete the placeholder. Again, the rest of the group will stay the same, unless there is only one additional placeholder in the group - in which case the group will be removed
You can also create a group from groups, or from a mix of placeholders and groups. You will be able to inherit the logic from the grouped-group or from the grouped-placeholder. This is currently the only way to add a placeholder to an existing group - by creating a new group that contains the old group and the placeholder.
Although that's not the purpose of this capability, you can use group to copy a logic from one placeholder to another - Group the "source" placeholder with the "destination" one, choose to inherit the logic from the "source" one, and then ungroup then - the logic was copied to the other placeholder.
When should I use "Group" and when should I use "Studio Data"?
Both Studio Data and Group allow for reusing the same logic in different places. In the example above, I could have used "Studio Data" to determine the "preferred contact method", and then for each of the placeholders, write a very simple logic: "When preferredContactMethod equals email, show agentemail; when preferredContactMethod equals phone, show phone..." and so on.
Modifying the logic is now simple - Changing the order of the conditions or their "when" conditions would impact both the Label text-placeholder and the icon Image-placeholder - but I should still have defined it in two places, even though the definition was quite simple.
Using Groups, however, I'd only have to define the logic in one place (rather than 3: full logic in Studio Data, simplified logic in each of the placeholders. And if I had 3 placeholders? or 5?), and I wouldn't "clutter" the Data Library with unnecessary Studio Data elements I'm only using in scene.
At the end of the day, it's your decision. Frequently, there is more than one way to do something, and it's up to your experience and personal preferences. However, as a rule of thumb, when all of the conditions below apply - using groups is probably the better choice:
- Multiple placeholders
- At the same scene (can be across multiple frames (formerly called scene parts))
- Sharing the same "when" logic (the "show" / "don't show" and its value is defined individually, per placeholder)
If I was using the "preferredContactMethod" in an additional scene, I would have used it as a Studio Data element - but in the ContactAgent scene, I'd still use Group to define the logic in just two places rather than <number of grouped PH + 1>.