0

I was trying to update a data extension with suscriber data about interests, I recently added 2 new rows, as this is filled with records from a register form, I'm planning to send an email with a small description and a button with an CloudPage URL.

The landing page is contains a pre populated form with the data I already have. I just want to obtain the interest info for this I'm using select labels.

This is an URL example : https://cloud.mailgranplan.com/actualizar-intereses?qs=c432442b25e5d77d1373366298a3e29cdf36d30cd7b7b6a9f6563174bc418d845036de5070797a8533e3b5d520732d1edfb50363a173c28faf77cc012e38b4faa4278c5c55f2a5ef3bf9bfa46ccb878e08859f8e9ae1d82d

The AMPScript within the landing page is the following:

<!-- starts -->

<script runat="server" language="ampscript">

var @emailAddress, @firstName, @lastName, @interes_1, @interes_2

set @success = true

set @emailAddress = AttributeValue("Email")
set @firstName = AttributeValue("Nombre")            
set @lastName = AttributeValue("Apellido")                         
set @interes_1 = AttributeValue("Interes")
set @interes_2 = AttributeValue("Interes_2")

set @updatedDate = Now(1)

if Empty(@interes_1) or Empty(@interes_2) then
  set @success = false
else 
  UpdateData("Formulario Web",1,"Email", @emailAddress, "Interes", @interes_1, "Interes_2",@interes_2, "Updated", @updatedDate)
endif

</script> 

<!-- end -->

Someone could help me to know if Im in the right way or what I'm doing wrong?

Thanks in advance

  • what error you getting post here – pkharries Mar 21 at 5:17
0

@Fernando Madrid try like this and remove space with in Data Extension Name i mean you are trying to get form values right ?

%%[

var @emailAddress, @firstName, @lastName, @interes_1, @interes_2

set @success = true

set @emailAddress = RequestParameter('Email')


 set @firstName =RequestParameter('Nombre') 

set @lastName =RequestParameter('Apellido')

 set @interes_1 =RequestParameter('Interes')

 set @interes_2 =RequestParameter('Interes_2')


 set @updatedDate = Now(1)

  if Empty(@interes_1) or Empty(@interes_2) then
    set @success = false
    else 
  UpdateData("FormularioWeb",1,"Email", @emailAddress, "Interes", @interes_1, 
  "Interes_2",@interes_2, "Updated", @updatedDate)
  endif

   ]%%
  • Hi @pkharries, thanks . I just want to get form values to "interes" and "Interes_2", I want to keep it simple for the users. I tried with your suggestion but It takes me to a bad request page too, cloud.mailgranplan.com/False , I think could be the logic in the function but I'm still a beginner in the subject – Fernando Mar 21 at 16:04

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.