I created a survey on a marketing cloud landing page and sent it to another landing page using this html:

<form method="post" name="CustomerSatisfaction" action="%%=RedirectTo(CloudPagesURL(1682,'fullName',RequestParameter('fullName'),
'company',RequestParameter('company'),'email',RequestParameter('email'),'sex',RequestParameter('sex'),'rating',RequestParameter('rating'),'explain',RequestParameter('explain')))=%%" >

I am attempting to update an existing data extension with the results from this survey. The only column that is not in this code is the 'key', which is also my primary key for the DE. Below is my code:

%%[ /* Retrieve request */
VAR @fullName, @company, @email, @rating, @explain, @createDERecord
set @fullName = QueryParameter('fullName')
set @company = QueryParameter('company')
set @email = QueryParameter('email')
set @rating = QueryParameter('rating')
set @explain = QueryParameter('explain')
set @createDERecord = InsertData(

It's allowing me to publish, but when I try to open the website I get an "Internal Server Error 500".

How do I solve this?


Data Extension Structure


1 Answer 1


I will recommend you a better approach than what you are trying to achieve. You can have the same page to both contain the form as well as the submit logic.

Also, you do need to have your Primary Key in payload, as this is used to identify the row to be updated, or create a new row if the key value is not found. I have not included that key in the below example, as I am not sure of its name.

<html lang="en">


var @email, @fullName, @company, @rating, @explain, @createDERecord

set @fullName = RequestParameter('fullName')
set @company = RequestParameter('company')
set @rating = RequestParameter('rating')
set @explain = RequestParameter('explain')
set @email = RequestParameter('email')

if RequestParameter("submitted") == "submitted" then

   set @createDeRecord = InsertDE(


<form action="%%=RequestParameter('PAGEURL')=%%" method="post">
<label>Full Name</label>
<input type="text" name="fulname">

<input type="text" name="company">

<input type="text" name="email">

<input type="text" name="rating">

<input type="text" name="explain">

<input id="submitted" type="hidden" name="submitted" value="submitted" />

<input type="submit" value="Submit">

%%=IIF(RequestParameter("submitted") == "submitted", '<p>Your form has been submitted.</p>','')=%%

  • I am getting problems with this code. I replaced my code with your code for the form, the ampscript, and the iif and it didn't work. I also straight up made a new landing page copying and pasting your code and it also gave me errors. I checked my data extension and all the names match. Would you know what the problem is?
    – Intern
    Commented Jun 19, 2019 at 15:04
  • Initial guess: Are you editing your code in a code block? Or in the WYSIWYG editor? You must use code block, as your ampscript otherwise gets fubar. And what does "didn't work" mean? Commented Jun 19, 2019 at 15:08
  • I'm not sure what you mean by code block; I am using an html block from the content builder. What I mean is that the survey page opens, but when I fill out the survey and click the submit button I get a "500 - Internal Server Error" page
    – Intern
    Commented Jun 19, 2019 at 15:28
  • Can you share the structure of MonkeylessSurvey_DE_Intern in your question? E.g. by taking a screenshot of the field names and types . Commented Jun 19, 2019 at 16:19
  • I added the screenshot to the original post
    – Intern
    Commented Jun 19, 2019 at 16:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .