I've built a CloudPages form with a handler. The form opens via a dynamic link from an email, which is web.formurl.com/form?PID=xUNIQUEKEYHEREx. It uses the unique key to retrieve their data and pre-populate the form.
On submitting the form, it directs to the handler which gets all the variables from the form via RequestParameter("form field here"), and runs an upsert query to our data extension.
One of the parameters it doesn't pass is the unique key it used to open the form, as this is not used in the form as there is no question for it. However, I still need to pass it into the handler to be used in the Upsert query. Whereas with the other parameters I'm getting them from the form fields, eg
set @firstname = RequestParameter("Firstname")
This one has no field to retrieve it from. It is however stored as a variable on the previous page as @pidmask. I have tried
set @pidmask = RequestParameter(@PIDMask)
But this doesn't seem to work - when the upsert query runs, it overwrites this field with a null value (which violates my data integrity). Any pointers?