0

I have a cloudpage containing a Smart Capture form that submits to a data extension. I am using Smart Capture because a submission then instantly triggers a journey entry.

The idea is that a subscriber gets to the page via an email link. Clicking on the link passes through their SubscriberKey. I then do a lookup to see if that SubscriberKey exists in the smart capture DE or not.

If they have never submitted the form (ie: their SubscriberKey is NOT already in the smart capture DE), then I want the smart capture from to display.

If they have already submitted the form, then I want to hide the form and display an alternate message.

I was thinking of using some AMPScript logic like this:

%%[
     IF @result = 'eligible'
]%%
       <!-- SMART CAPTURE FORM -->
%%[ ELSE ]%%
        <!-- ALTERNATE MESSAGE -->
%%[ ENDIF ]%%

The issue I'm having is that when using the drag and drop editor with content blocks, the code view of the page doesn't show all the html for the form, etc. It instead only shows the basic "slot" divs. So I don't understand how to get the above to work.

Is this a feasible approach? Or is there another better way to show/hide content and/or content blocks on a page using AMPScript variables?

2

Drag in HTML or Free Form blocks into slots around your smart capture form and alternate content and enter your AMPScript business logic in these blocks, similar to this

enter image description here

| improve this answer | |
  • Works perfectly, thanks – Ben Jul 3 at 2:12

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.