2

Here is what I have so far:

%%[ IF @ClinicID == 33
THEN                                                      
Show HTML button
ELSE
Show Nothing
ENDIF ]%%

1 Answer 1

1

You would do it like this. You don't need a show nothing ELSE case:

%%[IF @ClinicID == 33 THEN ]%% <some> html button goes here </some> %%[ENDIF]%%

Just put the HTML in between CLOSED ampscript. You can add ELSEIF and ELSE the same way:

%%[IF @ClinicID == 33 THEN ]%% <some> html button goes here </some> 
%%[ELSEIF @ClinicID == 35 THEN ]%% <someother> html button goes here </someother> 
%%[ELSE]%% <somedefault> html button goes here </somedefault> 
%%[ENDIF]%%

Hope this helps.

6
  • When I use the first suggested line of code the block does not execute. I set up a test data extension to make sure the ClinicID was always 33. Any suggestions?
    – Realrx7
    Jul 23, 2014 at 17:31
  • How are you setting @ClinicID to be 33? Unless there is a SET call somewhere, its going to be something else. Please feel free to post the entirety of your ampscript and we'll have a look.
    – Timothy
    Jul 23, 2014 at 17:38
  • %%[VAR <at symbol>ClinicID SET <at symbol>ClinicID = ClinicID %%[IF <at symbol>ClinicID == 33 THEN]%% <some><p><img/link></some> %%[ENDIF]%% ]%%
    – Realrx7
    Jul 23, 2014 at 17:45
  • Every %%[ has to have a matching ]%%, and I'm not sure yours lines up correctly. Using you stuff, I would write %%[VAR <at symbol>ClinicID SET <at symbol>ClinicID = ClinicID ]%% %%[IF <at symbol>ClinicID == 33 THEN]%% <some><p><img/link></some> %%[ENDIF]%%
    – Timothy
    Jul 23, 2014 at 17:51
  • Thanks! Seems to be working now. If I want to use more than one ID can I use "IN (...)" or does it need to be a OR scenario?
    – Realrx7
    Jul 23, 2014 at 18:01

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.