I would like to make the following scenario work somehow:
- I have a template that contains a script inside. The script defines a variable called X and sets it value to 1.
- I also have a content block containing a script that reads the value of variable X does some action with it and then increments its value.
- Finally I have an email that is based on the template and contains two instances of the content block.
My expectation for this scenario is that when the first block reads the value of X it will get 1 and then the second block will get 2. But unfortunately it is not the case, both blocks read X as 1.
The question is if it is possible somehow to make this scenario work the way I expect.
Script in the template:
%%[ set @x = 1 ]%%
Script in the content block:
%%[ set @current_x = @x /* Do some stuff with @current_x */ set @x = @x + 1 ]%%