AmpScript Newbie wants to know

75 Views Asked by At

How do I write the ampScript code to this:

If the field energy_type is not empty then show the copy starting 'Until 30 March 2023...

Thanks in advance.

1

There are 1 best solutions below

0
edu8rdo On
%%[
Set @field_energy_type = AttributeValue("energy_type")
If Empty(@field_energy_type) Or @field_energy_type = "" Then
Set @value_energy_type = "Until 30 March 2023..."
Else
Set @value_energy_type = ""
EndIf
]%%
%%=v(@value_energy_type)=%%

Other examples can be found here: https://ampscript.guide/attributevalue/