I'm trying to perform a lookup to retrieve a records "MemberNumber" off their mobile number.
The data i'm dealing with has up to three different formats of numbers
either starting with a 0, 61 or no 0
Which means three lookups and the use of Substring and concat.
So to get around this I formatted the below:
%%[
VAR @KW, @LogDate, @MN, @VerificationCode, @MobileNumber1, @MobileNumber2, @MobileNumber3, @MemberNumber1, @MemberNumber2, @MemberNumber3
SET @KW=Uppercase( [MSG(0).NOUNS] )
SET @LogDate = Format(SystemDateToLocalDate(NOW()),"yyyy-MM-dd HH:mm:ss")
SET @MN = MobileNumber
SET @MobileNumber1 = MobileNumber
SET @MobileNumber2 = Substring(MobileNumber,2,12)
SET @MobileNumber3 = Concat('0', Substring(MobileNumber))
SET @MemberNumber1 = Lookup("Main_SMS_Database","MemberNumber","MobileNumber1", @MN, "CommunicationCode", "SMS0004")
SET @MemberNumber2 = Lookup("Main_SMS_Database","MemberNumber","MobileNumber2", @MN, "CommunicationCode", "SMS0004")
SET @MemberNumber3 = Lookup("Main_SMS_Database","MemberNumber","MobileNumber3", @MN, "CommunicationCode", "SMS0004")
IF @KW == "STOP" THEN InsertData("STOP_SMS_Database","Mobile", @MN, "Keyword", @KW, "EventDate", @LogDate)
]%%
Thank you for opting out of SMS.
%%[
ELSEIF @KW == "YES" AND Not Empty (@MemberNumber1) THEN InsertData("Reponses_DE","MobileNumber", @MobileNumber, "MemberNumber", @MemberNumber1, "MessageText", @KW, "EventDate", @LogDate)
]%%
We're passing on your request
%%[
ELSEIF @KW == "YES" AND Not Empty (@MemberNumber2) THEN InsertData("Reponses_DE","MobileNumber", @MobileNumber, "MemberNumber", @MemberNumber2, "MessageText", @KW, "EventDate", @LogDate)
]%%
We're passing on your request
%%[
ELSEIF @KW == "YES" AND Not Empty (@MemberNumber3) THEN InsertData("Reponses_DE","MobileNumber", @MobileNumber, "MemberNumber", @MemberNumber3, "MessageText", @KW, "EventDate", @LogDate)
]%%
We're passing on your request
%%[
ELSE
]%%
We didn’t quite understand that. If you’d like to request a call back, reply ‘YES’.
%%[
ENDIF
]%%
However it's returning a error no matter what I try.
Can anyone tell what I've done wrong in the above?
Any feedback would be very much appreciated.
Thanks,
Luke
Concat(‘0’, Substring(MobileNumber))
concat()
?