First, I'd suggest setting a primary key on your MatthewDataExtension
Data Extension, since the ClaimRow()
function is doing an update.
Also, every pair of ClaimRow()
parameters after the 2nd needs to be the variable name and then the variable value -- in order to retrieve the proper row. So if you're going to update WebPromoCode
and StoreCouponCode
, your function would be this:
%%[
var @numberCustomer
var @WebPromoCode
var @StoreCouponCode
set @numberCustomer = AttributeValue("Customer_No")
set @WebPromoCode = AttributeValue("WebPromoCode")
set @StoreCouponCode = AttributeValue("StoreCouponCode")
set @couponDataExtensionRow = ClaimRow("MatthewDataExtension", "isClaimed", "WebPromoCode", @WebPromoCode, "StoreCouponCode", @StoreCouponCode , "Customer_No", @numberCustomer)
/* Snip */
]%%
If it helps, here's my go-to coupon claiming AMPScript:
%%[
var @couponRow, @couponCode, @rows, @row, @emailaddr
set @emailaddr = AttributeValue("emailaddr")
set @rows = LookupRows("couponCodes","EmailAddress",@emailaddr)
if rowcount(@rows) > 0 then
set @row = Row(@rows,1)
set @couponCode= field(@row,"couponCode")
else
if _messagecontext == "PREVIEW" then
set @couponCode = "XX TEST XX"
else
set @couponRow = ClaimRow("couponCodes","IsClaimed","EmailAddress",emailaddr)
if empty(@couponRow) then
/* You can do other error handling here if you want.*/
/* This aborts the send */
raiseError("no more coupons available")
else
set @couponCode= field(@couponRow,"couponCode")
endif
endif
endif
]%%
Here's your coupon code: %%=v(@couponCode)=%%
There are a few more details about the Data Extension on in my blog post on the subject.
You can achieve this using the AMPscript function UpdateDE(1,2,3,4,5,6)
. You can find the full documentation including an example in the marketing cloud documentation on UpdateDE
Example:
UpdateDE("YourDataExtension",1,"_SubscriberKey",_SubscriberKey,"YourBoolean", "True")
Best Answer
I think you're looking for the
_DataSourceName
personalization string.Usage:
You may need to experiment with it if your send is every sent to more than one DE.
Update 2020-07-07
You can get a bunch of info about journey interactions via REST API. It'll give you all the details about the send context and email definition, etc. Technically, you could pull this data in an Automation with a Script Activity and store it in a DE. Similar to this, except with a REST call instead of WSProxy retrieve on the SOAP object.