Expand my Community achievements bar.

Dive in, experiment, and see how our AI Assistant Content Accelerator can transform your workflows with personalized, efficient content solutions through our newly designed playground experience.
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