Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save katydorjee/00ee53c6a6a40c0950408a40576668bd to your computer and use it in GitHub Desktop.

Select an option

Save katydorjee/00ee53c6a6a40c0950408a40576668bd to your computer and use it in GitHub Desktop.
Debug AMPscript using Server-Side JavaScript (SSJS)
<script runat=server>
Platform.Load("Core","1");
</script>
<script runat=server>
try{
</script>
%%[
SET @SKey = RequestParameter("skey")
SET @resultSet = LookupRows("Preference DE","Subscriber_Key", @SKey)
IF RowCount(@resultSet) > 0 THEN
SET @row = row(@resultSet,1)
SET @FirstName = Field(@row,"First_Name")
SET @LastName = Field(@row,"Last_Name")
SET @Email = Field(@row,"Email_Address")
SET @Mobile = Field(@row,"Mobile")
ENDIF
]%%
<script runat=server>
}catch (ex){
Write(Stringify(ex));
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment