Expand my Community achievements bar.

Never miss an update of the Adobe Journey Optimizer Community Lens! Subscribe now to get the latest updates, insights, and highlights delivered straight to your inbox every time a new edition drops.
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

Level 2

That worked, thank you.

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