Created
June 5, 2017 18:18
-
-
Save katydorjee/00ee53c6a6a40c0950408a40576668bd to your computer and use it in GitHub Desktop.
Debug AMPscript using Server-Side JavaScript (SSJS)
This file contains hidden or 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
| <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