Snippet variables ≠ free parameters.They depend on an object or primitive value passed from the caller context.A page cannot “inject” an enum literal directly into a snippet.
Option A (Recommended – simple and modern):
Use a page parameter (e.g. entity TaskHelper with StateEnum attribute).
In the main page, create two Data Views, each with its own helper having the desired enum value (“InProgress”, “Closed”).
Place your snippet inside each Data View → now the snippet variable can read $currentObject/StateEnum.Only one helper per tab, no microflows, works cleanly.
Option B (Microflow source):
Each tab’s Data View calls a microflow that returns a helper with the correct enum value.
The snippet then uses that variable inside XPath.⚙️ Slightly heavier, but works without manual object creation.
Option C (Bypass snippet variable):
Keep one generic snippet.
Add XPath constraint using [State = '[%CurrentTabValue%]'] dynamically via a context entity or tab-specific data source microflow.⚙️ This gives more flexibility but adds microflow logic.
Snippet variables ≠ free parameters.
They depend on an object or primitive value passed from the caller context.
A page cannot “inject” an enum literal directly into a snippet.
Option A (Recommended – simple and modern):
Use a page parameter (e.g. entity TaskHelper with StateEnum attribute).
In the main page, create two Data Views, each with its own helper having the desired enum value (“InProgress”, “Closed”).
Place your snippet inside each Data View → now the snippet variable can read $currentObject/StateEnum.
✅ Only one helper per tab, no microflows, works cleanly.
Option B (Microflow source):
Each tab’s Data View calls a microflow that returns a helper with the correct enum value.
The snippet then uses that variable inside XPath.
⚙️ Slightly heavier, but works without manual object creation.
Option C (Bypass snippet variable):
Keep one generic snippet.
Add XPath constraint using [State = '[%CurrentTabValue%]'] dynamically via a context entity or tab-specific data source microflow.
⚙️ This gives more flexibility but adds microflow logic.
Thanks Uggirala Mentaraju, but all your suggestions need a helper object and that is what I would like to avoid. (Thus the functionality is the same as it used to be with object parameters.)
If the only usage of the variable to be able to calculate something on call based on a parameter, that could've been used elsewhere, so I don't really see the difference.
I'm still looking for an explanation, how variables in snippets add extra functionality.