The Error
Error 1: Script SET Statement Invalid
An error occurred when attempting to resolve a script expression. See inner exception for detail. Script Expression: ClaimRow("MatthewDataExtension", "isClaimed", "WebPromoCode", "StoreCouponCode", "Customer_No", @numberCustomer) MemberID: 7221103 JobID: 0 The Data Extension field name for a ClaimRow function call is invalid. A field of this name does not exist. Function Call: ClaimRow("MatthewDataExtension", "isClaimed", "WebPromoCode", "StoreCouponCode", "Customer_No", @numberCustomer) Data Extension Name: MatthewDataExtension Field Name: isClaimed Parameter Name: BoolClaimedColumnName Parameter Ordinal: 2
Invalid Content:
set @couponDataExtensionRow = ClaimRow("MatthewDataExtension", "isClaimed", "WebPromoCode", "StoreCouponCode", "Customer_No", @numberCustomer)
The ampscript
%%[
var @numberCustomer
set @numberCustomer = [Customer_No]
var @couponDataExtensionRow
set @couponDataExtensionRow = ClaimRow("MatthewDataExtension", "isClaimed", "WebPromoCode", "StoreCouponCode", "Customer_No", @numberCustomer)
var @codeOnline
var @barCode
IF NOT EMPTY(@couponDataExtensionRow) THEN
set @codeOnline = FIELD(@couponDataExtensionRow,"WebPromoCode")
set @barCode = FIELD(@couponDataExtensionRow, "StoreCouponCode")
ENDIF
]%%
The Data Extension
The Actual Data
Research and other items
I've checked this question, but my data extension doesn't have spaces in the name. I've also checked the documentation for ClaimRow, and I thought I had it set up correctly. I'm seeing this error when I try to validate my email. The invalid content
appears to be for the isClaimed
content. Am I right in thinking that, and is false
an invalid option there? My apologies if it's something obvious, it's my first day with ampscript and Salesforce.
Updated ampscript
I updated the script as suggested, but I'm still getting the same errors:
%%[
var @numberCustomer
set @numberCustomer = AttributeValue("Customer_No")
var @WebPromoCode
set @WebPromoCode = AttributeValue("WebPromoCode")
var @StoreCouponCode
set @StoreCouponCode = AttributeValue("StoreCouponCode")
var @couponDataExtensionRow
set @couponDataExtensionRow = ClaimRow("MatthewDataExtension", "IsClaimed", "WebPromoCode", @WebPromoCode, "StoreCouponCode", @StoreCouponCode, "Customer_No", @numberCustomer)
var @onlineCode
var @barcode
IF NOT EMPTY(@couponDataExtensionRow) THEN
set @onlineCode = FIELD(@couponDataExtensionRow,"WebPromoCode")
set @barcode = FIELD(@couponDataExtensionRow,"StoreCouponCode")
ENDIF
]%%
The isClaimed
column was changed in the DE to IsClaimed
.
I've also tried a smaller ClaimRow()
:
var @couponDataExtensionRow
set @couponDataExtensionRow = ClaimRow("MatthewDataExtension", "IsClaimed", "Customer_No", @numberCustomer)
Which at least gives me a different error:
Error 1: Script SET Statement Invalid
An error occurred when attempting to resolve a script expression. See inner exception for detail. Script Expression: ClaimRow("MatthewDataExtension", "IsClaimed", "Customer_No", @numberCustomer) MemberID: 7221103 JobID: 0 The Data Extension field name for a ClaimRow function call is invalid. A field of this name does not exist. Function Call: ClaimRow("MatthewDataExtension", "IsClaimed", "Customer_No", @numberCustomer) Data Extension Name: MatthewDataExtension Field Name: IsClaimed Parameter Name: BoolClaimedColumnName Parameter Ordinal: 2
Invalid Content:
set @couponDataExtensionRow = ClaimRow("MatthewDataExtension", "IsClaimed", "Customer_No", @numberCustomer)