2

Let's say that I am calling a field that does not exist in my data extension.

How can I prevent AMPScript from not throwing an error if the field does not exist?

Let's say that I am doing an if statement referencing a field that does not exist.

%%[
SET @orderNumber = ORDER_NUMBER

if(@orderNumber == 10002) then
set 
else
]%%

The code above will display an exception because the ORDER_NUMBER field does not exist. Using AMPScript how can i prevent this error?

Thanks,

1
  • 1
    IS this somehow related to Salesforce ? Commented Jul 17, 2015 at 8:48

1 Answer 1

0

If you use the AttributeValue() function, it'll return an empty string if it doesn't exist:

%%[

SET @orderNumber = AttributeValue("ORDER_NUMBER")

if (@orderNumber == 10002) then
    /* code */
else
    /* code */
endif

]%%

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .