1

I am using AMPScript in my email and some time it return error so my interaction journey failed. I have two questions.

  1. If I have 20 contacts to add to journey and one of the email going to fail due to AMPScript bad data in DE, will my all emails going to fail?

2.Is there any thing try,catch like functionality available in ampscript to avoid errors or something like this?

Best Wishes

2 Answers 2

1

Journey emails are Triggered Send Definitions, so subscribers go in one at a time. If one fails, it won't cause the other ones to fail, but it may pile up the trigger queue -- requiring some intervention to resolve.

If there's no opportunity to validate the send audience beforehand, it's best to proactively check you send context values and then utilize the RaiseError() function to skip the subscribers. I code every email using this pattern (maybe not with the RaiseError(), but at least with my "no-naked personalization strings" rule:

%%[

var @contextField1
set @contextField1 = AttributeValue("contextField1")

if not empty(@contextField1) then

 /* do stuff */

else 

  RaiseError("invalid context data", 1) /* 1 means skip the subscriber */

endif

]%%

You could use a Server-side JavaScript try/catch with AMPscript, but additional overhead is a byproduct.

-1

Dell,

As soon as your send encounters a contact with invalid data and returns that error it will fail and will not attempt to send to further contacts in that DE.

If you opened your DE and saw your contacts ordered from top to bottom anything after a contact with invalid data won't be sent to.

I'm not aware of any functionality like that however you can create a support case to get further details regarding the error you're encountering.

0

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.