instead of using a 3rd party survey tool - my organization has chosen to roll-out NPS using Ampscript. My challenge is two-fold: 1) The 0-10 score form is built into an email 2) The follow-up questions are an a marketing cloud landing page 3) We want to allow people to take the survey multiple times - so we do not want to overwrite previous responses. 4) I know that I have to use "Insert" data versus "Upsert" to avoid the overwrite

So how do I capture the score in the email and the follow-up answers on the cloud page to write to the same row in the database.

One idea I was given was to create a proprietary key for each email response - which passes the the follow-up questions(?). I'm not Ampscript savvy - 6 months new to it - use it when i have to.

On the email - each button (0-10) is a submit button (since you can only pick one with NPS). Here is the code for the first two (0, 1) of them:

    <td style="padding:0px 0px 0px 0px">
      <a href="http://web.go.hanover.com/Q2Product?id=%%ID%%&N=0" target="_blank"><img src="http://image.go.hanover.com/lib/fe3d15707564057e761c72/m/1/068fc805-1551-4368-9dc6-6288889c0d69.jpg" alt="0" style="font-family: Arial, Helvetica,sans-serif; font-size:18px; border:0px; display:block; color:#00355e; height:50px; width:50px" width="50" height="50"></a>
    <td style="padding:0px 0px 0px 0px">
      <a href="http://web.go.hanover.com/Q2Product?id=%%ID%%&N=1" target="_blank"><img src="http://image.go.hanover.com/lib/fe3d15707564057e761c72/m/1/00ba1871-4366-4959-bf8d-b318131a10d7.jpg" alt="1" style="font-family: Arial, Helvetica,sans-serif; font-size:18px; border:0px; display:block; color:#00355e; height:50px; width:50px" width="50" height="50"></a>

Let me know what else I need to provide - this is a real stumper!

thank you - Marie


The simplest way would be to have the survey page be where the satisfaction survey (in email) lands and on that page, when processing the satisfaction survey, have it set a GUID and pass that into the DE. This can then be passed in again once they finish the rest of the survey on the website via a hidden input in the form. You then have the processing page do an update to the existing record.

Process would be:

  1. User Clicks Satisfaction Survey link in email
  2. User lands on survey page - initiates Server Side processing
  3. Create GUID
  4. Gather values via RequestParameter
  5. InsertData to DE of Satisfaction info
  6. Fill in Hidden Input in form with GUID
  7. User fills out survey
  8. POST of data to page for processing/update
  9. Gather values via RequestParameter
  10. Use GUID as identifier to match on and do an UpdateData call.

There are a lot of considerations around this though that you need to take into consideration when building this. Like how to handle those that land on the page, but somehow do not have an entry (via Satisfaction survey post) but complete the survey, etc.


set @myGUID = GUID()



Hidden Input:

<input name="GUID" type="hidden" value="%%=v(@GUID)=%%" />

UpdateData Call:



SET @Satisfaction = RequestParameter('Satisfaction')
  • 1
    I think this is it! My boss knows a LOT more ampscript than I do so I will review with him. Thank you. – mwemett Jan 17 at 20:31
  • 1
    HUGE THANK YOU - GUID was not on our radar - and it was the magic bullet. Can't thank you enough - wish I could award brownie points. – mwemett Jan 22 at 20:50
  • Glad to have helped. The best 'brownie points' you can give me are to provide assistance to the community where/when you can and give back as much as you take. – Gortonington Jan 23 at 15:13

Not sure i 100% get the ask but from what i understand it seems like you want to create a row with some but not all data and then on the landing page would have the remaining data that needs to be collected and insert that into the same row?

If so i would use the UpdateData function. With this function you can use multiple values to be able to select that same row in order to write more data to that same row.


If you already have ampscript written out, might help if you could provide that as well

  • We have to use the Insert command as we want to capture multiple submissions per person over time - so not overwriting. – mwemett Jan 17 at 20:27

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.