1
%%[ Var @msg  
if (Uppercase([MSG(0).NOUN(0)]) == "STEP2") then  
Set @msg = "Downtown"

else

Set @msg = "We're sorry that's incorrect"
endif ]%% 

%%= v(@msg) =%%

STEP2' is defined as Keyword. When I reply with STEP2, it is not identifying IF statement and enters into else statement everytime. Not sure why?? please help

1

If you want to retrieve the keyword from an MO (Mobile Originated) message, then you will need to use [MSG(0).VERB].

In MobileConnect verbs refer to keywords used in templates and nouns refer to MO replies (the strings preceding the verb).

However, due to the vague nature of your question, I'm not entirely sure what you are trying to achieve. If you simply want a user to send a keyword to a mobile number and then receive a reply, then you can simply create a Text Response message using the 'STEP2' keyword and have 'Downtown' as the response:

message field

However, if you want this message to be part of a series of messages (which I am guessing you do from your choice of keyword), then you can build a message chain by assigning next keywords to message templates. This enables two or more messages to be linked (or chained) together. When a user replies to a message with a noun and a next keyword is assigned to that template, then the message will be interpreted with the keyword. For example:

  1. User sends message 'SALE' to shortcode or longcode.
  2. Response message template has 'SALE1' set as Next keyword and sends outbound response message 'please send your email address'
  3. User replies 'sam@sample.com'.
  4. MO message is interpreted as 'SALE1 sam@sample.com' and is parsed by a message template.

This chain can continue for multiple messages as indicated below. Once the user reaches the last template in the chain, they will be ejected from the chain.

message chain

  • Thanks Eliot for replying. I am trying to build an interactive SMS. Mobile connect is not recognizing any other reply apart from Keyword. I have set up the same way you have explained above. My requirement is to capture any response given by the customer whether it is 'SALE2' or 'Hello World' – Susmitha SFMC Email spl May 17 '16 at 10:25
  • Hello Susmitha, MobileConnect needs to associate inbound (MO) messages back to a message template and it does this by using the assigned keyword. However, there is a way of achieving what you are looking for if you initially send a message to a subscriber then want them to reply (with or without a keyword). Is this how your SMS workflow works? Or will a mobile user send an SMS message to MobileConnect without first receiving an SMS from MobileConnect? – Eliot Harper May 17 '16 at 19:19
  • Yes Eliot. I have set up SALE2 as INbound message back to the template. however, it is accepting replies only from the specified keyword and throwing an error message when replied without a keyword. My requirement is to capture the reply (with or without a keyword) – Susmitha SFMC Email spl May 18 '16 at 7:17
  • Hello Susmitha, please can you (a) confirm if this is part of a message chain, and (b) confirm that SALE2 is a 'next keyword' from the previous message? I'm still unclear if mobile users receive an initial message and respond to it. Perhaps it would be better for you to connect with me on LinkedIn so we can have a brief call in order for me to understand this further. – Eliot Harper May 18 '16 at 10:14
  • Hi Eliot, thanks for the reply. Keyword Sale1 is configured as Outbound automation and the next Keyword mentioned is Sale2. we trigger sale1 with automation. and next keyword configured is Sale2 – Susmitha SFMC Email spl May 18 '16 at 10:33

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.