I need some help with the following implementation. I wanted to add a prefix to my dynamic tag and then want twig to fetch the value for this tag.
{% set result = 'text.journey_service_'~ data.addServ.serviceName %}
{{ result }}
Actual output => text.journey_service_SMALL_PET
Expected output => {{ text.journey_service_SMALL_PET }} = > Dog
This does not look valid:
If you want to concatenate a string and a variable, you should better use:
If you want to use
result
as the variable name to print something, you can use the following code (as given in Twig: Print the value of a variable where the variable name is String):