I'm trying to get variables on a microsite to pass from the form page to the thank you page. Passing the variables works, and loading them into a data extension, but getting them to also display passes null for the values. I've tried this using both the SSJS Write and stringify functions, and also passing them to ampscript variables, and neither works, but my DE is populated correctly. Code before the HTML open tag

VAR @Month, @Day, @month, @day
<script runat="server" language="javascript">
var monthChange = {
var submitterEmail = Request.GetFormField('email');
var submitterFirst = Request.GetFormField('name');
var submitterLast = Request.GetFormField('lastname');
var submitterMonth = Request.GetFormField('month');
  var adjustedMonth = monthChange[submitterMonth];
var submitterDay = Request.GetFormField('day');
var submitterDate = adjustedMonth + '/' + submitterDay + '/2018';
var sendDate = new Date(submitterDate);
if (IsEmailAddress(submitterEmail)) {
 var requestsDE = DataExtension.Init("dataextension");
      FirstName: submitterFirst,
      LastName: submitterLast,
      EmailAddress: submitterEmail,
           ReminderDate: sendDate
SET @month = @Month
SET @day = @Day
-!DOCTYPE html>
-html class="desktop" lang="en">
-head class="at-element-marker">

and then in the page

Got it! We’ll send you a reminder on %%=v(@month)=%%, %%=v(@day)=%%.

I can't figure out what I'm doing wrong.

  • 1
    Hi Erik! I just wanted to let you know that the expected path for importing code is to prefix each line with four spaces or a tab, or by wrapping the code in the tilde ("`") character, or by using the format code button ("{}" in the editor). The typical HTML <code> doesn't render quite as well here. I've gone ahead and fixed this one for you. – sfdcfox May 3 '18 at 1:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.