I have a list of contacts from the Sales Cloud that I have imported into a MobileConnect list. I stored the Id of a Person Account record from Sales Cloud as the "Contact Key". Here's the CSV file that I have used to import the contact into the MobileConnect list.
_MobileNumber,_LastName,_FirstName,_Email,_CountryCode,_ContactKey 91990007913,Smith,Jane,[email protected],AU,0019000003edTguAAE
I mapped the _ContactKey column to the "Contact Key" field on the MobileConnect list. The contact was imported and I can see that the Id from the Person Account record of the Sales Cloud is now the Contact Key in the Marketing Cloud.
I have set up a campaign whereupon receiving a keyword from the subscriber, I want to update a specific field in the Sales Cloud Contact record.
I have used the following lines of code in my Text Response message associated with the keyword. From the various articles and stackexchange questions and answers, I gather that the Contact Key is the SubscriberKey
Here's the text representation of the code. I couldn't get the formatting right. When I try sending an Outbound message and responding with the TESTBED keyword, all I get in response is "There was an error processing your message.". I'm not sure what I am doing wrong. Any help would be much appreciated.
%%[
var @response, @contactId, @subscriberKey, @result
if trim(uppercase([MSG(0).NOUN(0)])) == "TESTBED"
set @contactId = Lookup("_MobileAddress","_ContactID","_MobileNumber",mobile_number)
set @subscriberKey = Lookup("_Subscribers","SubscriberKey","SubscriberID",@contactId)
set @result = UpdateSingleSalesforceObject("Account",@subscriberKey,"Opt_Out__c","true")
set @response = CONCAT("TESTBED message received. Thank you.", " Opt Out Result is ", @result)
else
set @response = "Sorry, we did not recognise your response."
]%%
%%=v(@response)=%%
Lookup
function, is you DataExtension name _MobileAddress and _Subscribers?mobile_number
try changing that toMOBILE_NUMBER
. Personalization string should always be written as they are mentioned. you can visit help.marketingcloud.com/en/documentation/exacttarget/content/… for more information