0

I have a SMS which executes an UpsertData command to update data in DE. here is the code AMPSCRIPT

%%[ SET @msg = "Vous êtes maintenant désabonné(e)" 
SET @rows = LookupRows("ENT.CUSTOMER_LOT_6", "PHONENUMBER", MobileNumber) 
SET @rowCount = rowcount(@rows) 
IF @rowCount > 0 THEN 
FOR @i = 1 to @rowCount DO 
SET @row = row(@rows,@i) 
SET @DEColumn1 = field(@row,"UID_TARGET") 
***SET @UpdateEvent = UpsertData( "ENT.FRANCE STOP LOT 6",1,"UID_TARGET", @DEColumn1, "OPTIN_SMS", false, "UPDATE_DATE", NOW(), "OPTIN_SMS_DATE", NOW())*** 
NEXT @i ENDIF]%% 
%%=v(@msg)=%%

It works with

SET @UpdateEvent = UpsertData( "ENT.STOP_LOT_6",1,"UID_TARGET", @DEColumn1, "OPTIN_SMS", false, "UPDATE_DATE", NOW(), "OPTIN_SMS_DATE", NOW())

but not with the code above.

I tried [FRANCE STOP LOT 6], FRANCE STOP LOT 6, ENT.[FRANCE STOP LOT 6] i received this error message "il y a une erreur"

1

Does the 'CUSTOMER_LOT_6' Data Extension exist in a Child BU and you are trying to access it from a Parent BU?

You can't query a Data Extension that resides in a child BU from the Enterprise BU. FYI, child BU DE's are stored within the C-level schema, but there's no way of querying this schema.

The only solution would be to make the DE shared, then append the prefix ENT. before the data extension name to query it from your Enterprise BU.

However, I suspect this issue isn't actually related to your DE and is due to the fact that you are trying to lookup rows in your Data Extension where the field 'PHONENUMBER' matches the Contacts mobile number (that is, the mobile number that is used to send the SMS). If that's the case, then you will need to change MobileNumber to use the system data personalization string MOBILE_NUMBER.

If you still have issues, then I would try debugging this by dropping the code into an email and replacing the mobile number with a string that exists in the Data Extension. That should reveal any related AMPscript errors.

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.