Expand my Community achievements bar.

Join us for the Adobe Journey Optimizer Community Q&A Coffee Break on 1st October at 8 am PT with Journey Optimizer experts Amarnath Vannarath, Ariel Sultan, Arthur Lacroix and Sandra Hausmann.
SOLVED

Assign a value of a variable, back to the variable

Avatar

Level 2

I want to assign the value of this replaced value back to the same variable.

{%= replaceAll(itin_1_img_alt,"-"," ") %}
 
something like,
  {% let itin_1_img_alt = "This-is-my-ALT-tag" %}
  {%  itin_1_img_alt = replaceAll(itin_1_img_alt,"-"," ") %}
 
Thanks,
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@GeorgeVi2 Try this,

{% let itin_1_img_alt = "This-is-my-ALT-tag" %}
{% let itin_1_img_alt = replaceAll(itin_1_img_alt,"-"," ") %}
{%= itin_1_img_alt %}

Thanks, Sathees

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

@GeorgeVi2 Try this,

{% let itin_1_img_alt = "This-is-my-ALT-tag" %}
{% let itin_1_img_alt = replaceAll(itin_1_img_alt,"-"," ") %}
{%= itin_1_img_alt %}

Thanks, Sathees

Avatar

Employee Advisor

@GeorgeVi2  - you should also take a look at recent improvements that provide the ability to set global variables in expression fragments that can be replaced easily: 

Customizable fragments | Adobe Journey Optimizer