Loading

How To use MobileConnect AMPScript MSG(0), VERB and NOUN(0)

Veröffentlichungsdatum: Oct 13, 2022
Beschreibung
Through this article the MSG(0), VERB and NOUN(0), MobileConnect AMPScript functions are explained and displayed in an example that adds to the explanation. The goal of this article is to expand on the current Salesforce Developer resources that are linked through the Additional Resources section at the bottom.
Lösung
MSG(0) - Use this function to return the specified MO keyword used in a mobile message conversation. You can only retrieve the current keyword from MobileConnect.
MSG(0).VERB - This will return the message keyword (There can only be one keyword).
MSG(0).NOUNS - This will return the messages after the keyword.
MSG(0).NOUN(i) where i >= 0 - This will return the i noun in the message where 0 is the first noun and 1 is the second noun after the keyword.

Below is an example of a "Vote/Survey" template.

Example Initial Outbound:
Text 'MOREFUN YES PLEASE' for Yes or 'MOREFUN NO THANKS' for No to 36698.
  • The VERB will return the message keyword MOREFUN.
  • The NOUNS will return message YES PLEASE or NO THANKS
  • The NOUN(0) will return the first noun in the message either YES or NO
  • The NOUN(1) will return the second noun in the message either PLEASE or THANKS
Example Outbound response:
%%[
set @Phone = Mobile_Number
set @response = [MSG(0).NOUNS]
set @msgKeyword = [MSG(0).VERB]
set @noun = [MSG(0).NOUN(0)]
set @noun1 = [MSG(0).NOUN(1)]
]%%
Thank you for that. %%=v(@Phone)=%% %%=v(@response)=%% %%=v(@msgKeyword)=%% %%=v(@noun)=%% %%=v(@noun1)=%%

When you text MOREFUN YES PLEASE to 36698, you will receive an output response "Thank you for that. 13175555555 YES PLEASE MOREFUN YES PLEASE"

Note: You will need [ ] surrounding each AMPScript variable.

Additional Resources:
Nummer des Knowledge-Artikels

000389803

 
Laden
Salesforce Help | Article