AMP script error with conditional statement

861 Views Asked by At

We are sending emails via salesforce markering cloud in response to actions on our website. The idea is that we store data related to the subject of the email first via their api. When we have a confirmation that everything is stored we add data to a transactional email queue. The problem is that when this email is triggering we are attempting to use the data previously stored in the markering cloud. But we run into an issue were sometimes the data isn't available yet - maybe their internal transfers between different data stores is a bit slower then the triggering.

%%[ if @itemsRowCount > 0 then for @a = 1 to @itemsRowCount do var @DE_Image ....

This line is attempting to check that if we have data, render that data, otherwise ignore it.

We however get this error from the api.

The initial end count value for the for loop could not be cast to an integer.

And the code they are referencing in the email:

for @a = 1 to @itemsRowCount do var @DE_Image

However, Should our if catch this error? Or could the if statement be true in any other case?

0

There are 0 best solutions below