0

I have a script setup where I want to show two separate values in the same line of HTML. sometimes the values will be equal. So instead of showing duplicate I need to write a function to display just the second value.

Is there a function that can do this? Can't find any documentation on it.

I've tried this already.

%%=IIf(@Value1=@Value2),(%%=v(@Value2=%%)),(%%=v(@Value1)=%% %%=v(@Value2)=%%)=%%
2

It'd be something like this:

%%=iif(@Value1 == @Value2, @value2, concat(@value1, " ", @value2))=%%

Or in long form for comparison:

%%[

if @value1 == @value2 then

 output(concat(@value2))

else

 output(concat(@value1," ",@value2))

endif

]%%

Double-percent notation is only valid outside AMPScript blocks and functions.

|improve this answer|||||
0

%%[

if @value1 == @value2 then

output(concat(@value2))

else

output(concat(@value1," ",@value2))

endif

]%%

|improve this answer|||||
  • Please also add some words about your solution. – Basti Nov 16 '17 at 7:48

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.