I need help with updating existing data in a data extension. When a user clicks on an email link to change their status, I need it to be changed in the data extension. For example, if user A has status X , when he clicks the button , they need to be updated to status Y. I need to do it in AMPscript. Can you help me with this?
This is the code I've written so far:
%%[
var @reservationid, @hotel_name, @city, @country, @fromdate, @todate, @value, @customerid,@reservationstatus
set @reservationid = RequestParameter("reservationid")
set @reservationstatus = RequestParameter("reservationstatus")
set @customerid = RequestParameter("customerid")
set @hotel_name = RequestParameter("hotel_name")
set @city = RequestParameter("city")
set @country = RequestParameter("country")
set @value = RequestParameter("value")
set @fromdate = RequestParameter("fromdate")
set @todate = RequestParameter("todate")
set @salutation = RequestParameter("salutation")
set @firstname = RequestParameter("firstname")
set @lastname = RequestParameter("lastname")
Var @Submit
Set @Submit = RequestParameter('submitted')
If @Submit == 'submitted' Then
UpsertDE('Final_Task_Table',1,'reservationid',@reservationid,'reservationstatus', 'cancelled')
Endif
]%%
<input type='hidden' name='submitted' value='submitted' />