This one has me stumped. I have the following AMPScript in an email:
%%[ var @em, @couponRow, @couponCode if _messagecontext == "PREVIEW" then set @couponCode = "XX TEST XX" else set @em = AttributeValue("emailAddr") set @subkey = AttributeValue('_subscriberkey') set @jobid = AttributeValue('JobID') set @dateclaimed = SystemDateToLocalDate(Now(1)) set @couponRow = ClaimRow('Test_CouponCodes', 'IsClaimed','Email',@em,'Subscriberkey',@subkey,'DateClaimed',@dateclaimed,'JobID',@jobid) if empty(@couponRow) then RaiseError("No coupons available", false) else SET @couponCode = Field(@couponRow, "CouponCode") endif endif ]%%
When I do a normal send via Email Studio, this works correctly, that is: one row is claimed for each subscriber.
However, I then used the same email in a journey and when it runs, I now see that two rows have been claimed for each subscriber.
I edited the journey and put a 3 Minute Wait period at the start (before the email gets send) to see what happens. Again, two rows get claimed, but now I can see a three minute gap between the times that the first and second set were claimed.
So it's as if upon entering the journey, the claimrow() function fires. Then it fires again when the email that contains the claimrow() function gets sent.
No idea what's going on here! Has anyone seen this before?