Nested snippets allow you to use a snippet inside another snippet in Strategy Designer, including recursively (a snippet calling itself) or mutually (snippet A calling B and B calling A). This significantly increases reusability, but also introduces new considerations for activation, versioning, and debugging.
Target Audience
-
Business analysts and pricing managers designing strategies in Strategy Designer.
-
Solution consultants and implementers configuring reusable logic.
-
Administrators who need to understand activation and versioning impacts of nested snippets.
Prerequisites
Before working with snippets within snippets, ensure that:
-
Strategy Designer is available and configured in your partition.
-
Snippets are already enabled and you are familiar with basic snippet concepts (creating, using in strategies, versioning).
-
You understand the Activation and Versioning rules for strategies, snippets and lookups.
For background see Nested Snippets (snippets within snippets) | See Also
What is a Nested Snippet?
A nested snippet is a snippet that uses another snippet as a block in its own workspace (child snippet inside a parent snippet). Strategy Designer supports:
-
Using a snippet inside any other snippet.
-
Using the same snippet inside itself (self-recursion).
-
Mutual references where snippet A calls B and B calls A.
Typical Use Cases
Nested snippets are especially useful when:
-
You want a driving snippet to orchestrate multiple smaller snippets (e.g., several markdown or pricing factor snippets) and choose which ones to apply.
-
Common logic (e.g., rounding, eligibility checks, normalization) should be shared between multiple higher-level snippets.
-
You want to layer abstraction: low-level data access/lookups, mid-level calculations, and high-level orchestration, each as separate snippets.
Creating a Simple Nested Snippet
This section walks through a simple case where Snippet A calls Snippet B.
Step 1 – Create or Identify the Child Snippet
-
Go to the Snippets tab.
-
Either:
-
Create a new snippet using Add > New Snippet, or
-
Open an existing snippet that you want to reuse as a child.
-
-
Design the snippet as usual:
-
Define arguments (names, types, defaults) as needed.
-
Build the logic inside the snippet body.
-
Connect its output to the Return field.
-
This snippet will become the child snippet (Snippet B).
Step 2 – Create the Parent Snippet
-
Still on the Snippets tab, use Add > New Snippet to create another snippet (Snippet A).
-
Define its arguments and return type (via the block connected to Return) according to what the higher-level logic should expose.
Step 3 – Insert the Child Snippet into the Parent
-
With Snippet A open:
-
Locate Snippet B in the Toolbox under Snippets.
-
Drag the Snippet B block into Snippet A’s workspace.
-
-
Wire Snippet B’s inputs:
-
Provide values directly.
-
Or forward values from Snippet A’s arguments (e.g., pass-through or transformed values).
-
-
Use Snippet B’s output:
-
Connect its output into Snippet A’s logic (e.g., arithmetic operations, conditions).
-
Optionally, connect it directly to Snippet A’s Return to simple wrap B.
-
At this point, you have created a nested snippet: Snippet A depends on Snippet B.