I have two microsite cloud pages: (1) to ask a user for the information, and (2) one that takes the information and uses it in a SSJS WSProxy call
The first page captures information like:
<form id="myForm" method="post" action="xxxxxxxxxxxxx">
<input type="text" name="deCustKey"/>Data Extension External Key<br />
<input type="text" name="retrieveMid"/>Retrieve MID<br />
<input type="text" name="createMid"/>Create MID<br />
<input type="text" name="folderID"/>Target Folder<br />
<input type="text" name="name"/>Name of New DE<br />
<input type="text" name="description"/>Description of New DE<br />
<input type="submit" />
</form>
The problem is that the second microsite page (referenced by the xxxxx above) does not seem to be capturing the variables from this first page.
I have tried using the following in the body tag (which is before my SSJS) and then
/* before SSJS */
<input id="deCustKey" type="hidden" value="%%=v(@deCustKey)=%%">
<input id="retrieveMid" type="hidden" value="%%=v(@retrieveMid)=%%">
<input id="createMid" type="hidden" value="%%=v(@createMid)=%%">
<input id="folderID" type="hidden" value="%%=v(@folderID)=%%">
<input id="name" type="hidden" value="%%=v(@name)=%%">
<input id="description" type="hidden" value="%%=v(@description)=%%">
/* within SSJS */
var deCustKey = Variable.GetValue('@deCustKey');
var retrieveMid = Variable.GetValue('@retrieveMid');
var createMid = Variable.GetValue('@createMid');
var folderID = Variable.GetValue('@folderID');
var name = Variable.GetValue('@name');
var description = Variable.GetValue('@description');
I have tried a couple others as well, but I am having difficulty passing these variables from client-side input on the first page into variable that I can access within my SSJS.
Thanks!
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script runat="server">
Platform.Load('Core', '1');
var deCustKey = Request.GetFormField('deCustKey');
var retrieveMid = Request.GetFormField('retrieveMid');
var createMid = Request.GetFormField('createMid');
var folderID = Request.GetFormField('folderID');
var name = Request.GetFormField('name');
var description = Request.GetFormField('description');
</script>
deCustKey is: <ctrl:var name=deCustKey/><br>
retrieveMid is: <ctrl:var name=retrieveMid />
createMid is: <ctrl:var name=createMid/><br>
folderID is: <ctrl:var name=folderID />
name is: <ctrl:var name=name/><br>
description is: <ctrl:var name=description />
</body>
</html>