Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
AMPscript and Server-Side JavaScript variable together
%%[
VAR @ProductName
SET @ProductName = "Mobile phone"
]%%
<script runat=server>
Platform.Load("Core","1");
//Get the Variable from AMPscript
var ProductName = Variable.GetValue("@ProductName");
Write("<b>SSJS value:</b> "+ProductName);
var price = "1500"
//Set the Variable to be accessible in AMPscript
Variable.SetValue("@price",price);
</script>
<br>
<b>AMPscript value:</b> %%=v(@price)=%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.