I'm not really up to scratch on Microsites and updating DEs off the back of them.

What I am trying to achieve:

A microsite that subscribers can access from links on our emails.

The microsite will be passed their subscriber key, and update a series of check-boxes based on a lookup of that subscriber key in a data extension (Boolean value for checked/unchecked).

The boxes can be changed however the person wishes, and they can click submit, and the relating Boolean values will be updated in the DE for that subscriber.

If the subscriber key is not yet in the DE, all checkboxes to be unticked. When they click submit, the subscriber key would be written to the DE with the relevant Boolean values.

Thus far I have built the DE, and have looked at using the upsertdata function to add/update the data, but I can't figure out how to set the checkbox values based on a lookup within that DE.

    <form id="myForm" method="post" action="handle form url">
        <input type="hidden" name="CNSMR_ID" value="%%=v(@CNSMR_ID)=%%" />
<Strong>Which destinations are you interested in for a future cruise?</strong><br />
<input type="checkbox" name="Destination" value="Europe North" />Northern Europe<br />
<input type="checkbox" name="Destination" value="Europe Med" />The Mediterranean <br />
<input type="checkbox" name="Destination" value="Caribbean" />The Caribbean<br />
<input type="checkbox" name="Destination" value="Alaska" />Alaska<br />
<input type="checkbox" name="Destination" value="Arabian" />The Arabian Coast<br />
<input type="checkbox" name="Destination" value="Far East" />The Far East<br />
<input type="checkbox" name="Destination" value="Australia" />Australia & New Zealand<br />
<input type="checkbox" name="Destination" value="Galapagos" />The Galapagos Islands<br /><br />
            <input type="submit" />
  • are you trying to store the checkbox value in DE? or fetching the value from DE? – Abhishek Jun 20 '17 at 23:30

I can list the steps:

  1. In your email use either MicrositeURL or CloudPagesURL https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/MicrositeURL.htm


This will pass the Subscriber and job data to the cloud page - you won't need to pass any query string parameters.

  1. Lookup your data extension using AMPScript


    SET @SubKey = _SubscriberKey SET @Data = LookupRows("DENAME", "SUBKEY_COL", @SubKey)

    SET @SubscriberExists = 0 IF RowCount(@Data) > 0 THEN SET @SubscriberExists = 1 SET @SubscriberData = Row(@Data, 1) SET @Subscribed = Field(@SubscriberData, "Subscribed") ENDIF


  2. All you need to do then is to check if the checkbox should be checked.

<input type="checkbox" name="subscribed" %%=IIF(@Subscribed == 1, "checked", "")=%% />

  1. What I would do next is to include a separate Microsite page to add the AMPScript processing code. So in your form action you'll include %%=MicrositeBaseURL(IDHERE)=%% - this will allow the subscriber data to pass on without passing any query string or form parameters with data you already have access to.

  2. Finally in your code you would retrieve the form field values and upsert them to the Data Extension

    SET @SubKey = _SubscriberKey SET @Subscribed = RequestParameter("subscribed")

    SET @Update = UpsertData("DENAME", "SUBKEY_COL", @SUBKEY, "Subscribed", @Subscribed)

I'll leave it to you to work on the rest but this is the main idea on it all.

  • Thank you so much, I now have the checkboxs correctly being checked if the subscriber data is in my DE. Now to work on having the form submission update those DE values :) – Gareth Jun 21 '17 at 10:26

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.