{"id":31580,"date":"2018-04-21T15:47:48","date_gmt":"2018-04-21T15:47:48","guid":{"rendered":"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/"},"modified":"2021-04-06T00:58:48","modified_gmt":"2021-04-06T00:58:48","slug":"setsmsconversationnextkeyword","status":"publish","type":"post","link":"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/","title":{"rendered":"SetSmsConversationNextKeyword"},"content":{"rendered":"<h2>SetSmsConversationNextKeyword<\/h2>\n<p>This function will set the keyword for the next message in a conversation. It does not create a new conversation.  Rather, it sets the next conversation path similar to <a href=\"\/createsmsconversation\">CreateSmsConversation<\/a>, but for an existing conversation. The Next Keyword is set once the Contact replies to the message.<\/p>\n<p>The function will return <code>true<\/code> if the next keyword is successfully set, or <code>false<\/code> if an exception occurs. The function can only be used in MobileConnect messages and will return <code>false<\/code> if used in a different application context, for example in Email Studio or CloudPages.<\/p>\n<h3>Arguments<\/h3>\n<p><code>SetSmsConversationNextKeyword(1,2,3)<\/code><\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center\">Ordinal<\/th>\n<th style=\"text-align: left\">Type<\/th>\n<th style=\"text-align: left\">Required<\/th>\n<th style=\"text-align: left\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center\">1<\/td>\n<td style=\"text-align: left\">Number<\/td>\n<td style=\"text-align: left\">True<\/td>\n<td style=\"text-align: left\">Short code or long code used by MobileConnect<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center\">2<\/td>\n<td style=\"text-align: left\">Number<\/td>\n<td style=\"text-align: left\">True<\/td>\n<td style=\"text-align: left\">Contact&#8217;s mobile number with country code prefix<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center\">3<\/td>\n<td style=\"text-align: left\">String<\/td>\n<td style=\"text-align: left\">True<\/td>\n<td style=\"text-align: left\">Keyword to use for Next Keyword function<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>NOTE: This function cannot be used in conversation-based templates such as Double Opt-In, Vote\/Survey or Info Capture messages.<\/p>\n<\/blockquote>\n<h3>Example<\/h3>\n<p>A message template includes the following code that is used in a Text Response message within an existing conversation:<\/p>\n<pre><code>%%[\n\nvar @discountAmount, @nextKeyword\nset @discountAmount = Lookup(\"SMS Offers\", \"Percent Discount\", \"Mobile Number\", MOBILE_NUMBER)\nset @nextKeyword = Concat(@offer,\"PERCENT\")\n\nSetSmsConversationNextKeyword(61401123456, MOBILE_NUMBER, @nextKeyword)\n\n]%%\nReply with your email address to receive %%=v(@discountAmount)=%%% percent off your next purchase.<\/code><\/pre>\n<p>The <code>@discountAmount<\/code> variable returns a number based on a value in the Data Extension. A matching keyword has been created for each discount; for example <code>10PERCENT<\/code>, <code>20PERCENT<\/code> and <code>50PERCENT<\/code>. These keywords are assigned to other Text Response messages.<\/p>\n<h4>Output<\/h4>\n<p>For a <code>@discountAmount<\/code> value of <code>20<\/code>, a Contact will receive the message below and the Next Keyword will be set as <code>20PERCENT<\/code> when they reply to the message.<\/p>\n<pre><code>Reply with your email address to receive 20% off your next purchase.<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SetSmsConversationNextKeyword This function will set the keyword for the next message in a conversation. It does not create a new conversation. Rather, it sets the next conversation path similar to CreateSmsConversation, but for an existing conversation. The Next Keyword is set once the Contact replies to the message. The function will return true if the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v14.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The AMPscript Guide - SetSmsConversationNextKeyword<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The AMPscript Guide - SetSmsConversationNextKeyword\" \/>\n<meta property=\"og:description\" content=\"SetSmsConversationNextKeyword This function will set the keyword for the next message in a conversation. It does not create a new conversation. Rather, it sets the next conversation path similar to CreateSmsConversation, but for an existing conversation. The Next Keyword is set once the Contact replies to the message. The function will return true if the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/\" \/>\n<meta property=\"og:site_name\" content=\"The AMPscript Guide\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-21T15:47:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-04-06T00:58:48+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ampscript.guide\/#website\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"The AMPscript Guide\",\"description\":\"The Definitive Scripting Manual for Salesforce Marketing Cloud\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ampscript.guide\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/#webpage\",\"url\":\"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/\",\"name\":\"The AMPscript Guide - SetSmsConversationNextKeyword\",\"isPartOf\":{\"@id\":\"https:\/\/ampscript.guide\/#website\"},\"datePublished\":\"2018-04-21T15:47:48+00:00\",\"dateModified\":\"2021-04-06T00:58:48+00:00\",\"author\":{\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\"},\"breadcrumb\":{\"@id\":\"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/\",\"url\":\"https:\/\/ampscript.guide\/setsmsconversationnextkeyword\/\",\"name\":\"SetSmsConversationNextKeyword\"}}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\",\"name\":\"dev\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31580"}],"collection":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/comments?post=31580"}],"version-history":[{"count":0,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31580\/revisions"}],"wp:attachment":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/media?parent=31580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/categories?post=31580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/tags?post=31580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}