I need to update sales cloud and a data extension whenever a customer replied UNSUB to the sms that we send using Marketing Cloud.

This is how I get the response

IF Uppercase([MSG(0).NOUN(0)]) == "UNSUB" THEN
//Update DE
//Update Sales Cloud

BUt I can't seem to make it work.

I also tried this

Set @inbound = [MSG(0).NOUN(0)]

IF UpperCase(@inbound) == "UNSUB" THEN
//update sales cloud
//update de

But upon doing a subscriber preview I get a "An Unrecognized expression appears in a script block"

I already tested the script block in cloud pages for updating sales cloud and de and it's working so I guess it's not the issue orrrrrr you can't update both sales cloud and de in one transaction in regards to response sms.

Am I Missing something? any tip or suggestion will do. Thanks

1 Answer 1


Your outbound message from Content Builder can't contain this code - for your unsub process to work, you actually need to have 2 messages:

  1. A message from the Text Response template that's configured in Mobile Connect which needs to be set up on a new keyword (like UNSUB). Here you need to implement the code you had before or the code I posted below.
  2. Your initial text message from Content Builder will now have to use the Next Keyword option you need to set it to your new keyword (like UNUSB). This option will not appear in Content Builder, but will be displayed in Journey Builder in Advanced Options when you configure your SMS for sends.

This will work this way:

Your outbound message gets sent to the customer and the system will know thanks to the Next Keyword that it should treat all incoming text (probably for a limited time period like an hour) as if it was coming to your Text Response message configured on the Unsub keyword.

Any tests of the Text Response keyword can be done by just sending the keyword. You won't get any information about sender of the sms apart from the number, so you will need to do lookups based on this information to your data.

Old answer before the comments posted below

I think I had the same issue, as I never could get [MSG(0).NOUN(0)] to work while using a Text Response template, so I went with a workaround:

set @inbound = [MSG(0)]
set @verb = [MSG(0).VERB]
set @message = Trim(Replace(@inbound, @verb, ''))
  • Dude I don't know why but I'm already getting this error on set @inbound = [MSG(0)] "An unrecognized expression appears in a script block. Script Expression: [MSG(0)]"
    – imajmdf
    Commented Feb 7, 2020 at 11:14
  • Ohhh btw, i created my sms in content build - SMS Message
    – imajmdf
    Commented Feb 7, 2020 at 11:18
  • I updated my answer to show you what you need to do. Commented Feb 7, 2020 at 11:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .