0

I created an html form as an email block that I will send inside the email. I would like to add the fields of a data extension where the destination fields will have the names exactly the same as the field in which the subscriber will write. Is this possible via AMPscript or just via SSJS?

I figured it would look something like this, but there are validation errors:

var @Nome, @Sobrenome, @EmailAddress, @Categoria 1, @Categoria 2, @Carta 

set @Nome = RequestParameter('Nome')
set @Sobrenome = RequestParameter('Sobrenome')
set @EmailAddress = RequestParameter('EmailAddress')
set @Categoria 1 = RequestParameter('Categoria 1')
set @Categoria 2 = RequestParameter('Categoria 2')
set @Carta = RequestParameter('Carta')

UpsertData("Teste-Survey",
           "Nome",@Nome,
           "SObrenome",@Sobrenome,
           "EmailAddress",@EmailAddress,
           "Categoria 1",@Categoria 1,
           "Categoria 2",@Categoria 2,
           "Carta",@Carta           
          )
]%%

HTML Form

enter image description here

  • 1
    Someone correct me if I'm wrong, but it's my understanding that a grand majority of email clients do not support dynamic forms within an email client. Your better option is to give the appearance of a form within an email but the entirety of the form would link off to a CloudPage smart capture form that would prefill the fields as they appear in the email. – Tom Callahan Nov 29 '18 at 20:05
  • 1
    RequestParameter is only for Landing pages and only pulls in information that is either passed in the head via a Form/POST or is appended to the URL via ? or via a GET. Also, as @TomCallahan said, HTML emails with forms are usually a no no due to very limited support and no 'self-posting' functionality. This means the form would need to post to a webpage anyway, which pretty much negates the whole purpose of having a form in the email anyway. – Gortonington Nov 29 '18 at 20:13
  • 1st your code requestparameter will not work in the email, as this is the function which is used to pull the form input attribute in the ampscript, 2nd in the email you will have to use UpsertDE function, 3rd you syntax for the upsert function is wrong, you are missing the number parameter the integer to build the number of where clause. – Abhishek Dec 2 '18 at 10:32
  • hello @Abhishek. But you indicate to utilize a form insert inside e-mail? Like the 'survey' tool will not available on classic content builder i'm looking up alternates without Landing Pages. Thanks for attention. – Joao Marano Dec 3 '18 at 12:34
  • hello @Gortonington. But you indicate to utilize a form insert inside e-mail? Like the 'survey' tool will not available on classic content builder i'm looking up alternates without Landing Pages. Thanks for attention. – Joao Marano Dec 3 '18 at 12:38

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.