0

I'm having issues with the following IF statement - it's causing the cloudpage it's on to report an internal server error. I'm assuming the issue is a syntax error somewhere, because I can't see anything else that would be an issue.

if @status == "notdelivered" then set @responseline = "Sorry to hear that. We will follow up with your wholesaler to find out what's happened to your order and contact you shortly."

elseif @status == "partial" then set @responseline = "Sorry to hear that. We will follow up with your wholesaler to find out why some products have not been delivered and contact you shortly."

else set @responseline = "Thanks for letting us know!"

endif

1 Answer 1

4

At a first glance, I don't see anything that should be throwing a 500 error. When you are testing new functionality on a Cloudpage, it's always a good idea to wrap your scripts within a try/catch so you can get a specific (i.e. more helpful) error indicator from SFMC.

<script runat="server">
Platform.Load("Core","1.1") ;
try {
</script>

/** YOUR AMPSCRIPT HERE **/

<script runat="server">
Platform.Load("Core","1.1") ;
} catch(e) {
Write(Stringify(e));
}
</script>
1
  • 1
    Thank you for this, I wasn't aware there was any way to get error messages from Ampscript. It turns out I had fixed the issue with a previous change, but another part of the script was erroring due to a duplicated primary key in the test data. Commented Jul 16, 2019 at 15:13

You must log in to answer this question.

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