AMPscript and Server-Side JavaScript variable together
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
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