Forum Discussion
2000andjames
28 days agoSupporter
Liquid: Can I add a variable to abort_message() function
Is there a way to pass in a variable or attribute when using abort_message() function? I've checked the documentation but I can't see a way to do it. I've tested variations and can only get plain t...
- 27 days ago
The Braze documentation explicitly says that you can't use Liquid within the abort statement – you must use strings. That's not explained on the documentation page you've linked above, but it is on the connected content documentation page.
I imagine that you would conditionally assign a value to the abort_reason variable. Why not do the abort_message conditionally? Something along the lines of:
{% if criteria for abort reason 1 %}
{% abort_message('reason1') %}
{% elsif criteria for abort reason 2 %}
{% abort_message('reason2') %}
{% else %}
{% endif %}
TedScott
26 days agoInfluencer
Taking it a step further, you cannot nest liquid (liquid inside of liquid), it's a limitation of liquid.
Related Content
- 8 days ago
- 11 months ago