<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Save a variable under a button click in Chatbot</title>
    <link>https://community.sinch.com/t5/Chatbot/Save-a-variable-under-a-button-click/ta-p/13176</link>
    <description>&lt;DIV class="lia-message-template-content-zone"&gt;&lt;P&gt;You can save &lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Variables-and-properties/ta-p/12280" target="_blank" rel="noopener"&gt;variables&lt;/A&gt; under button clicks if you're using a button step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To save a &lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Variables-and-properties/ta-p/12280" target="_blank" rel="noopener"&gt;variable&lt;/A&gt; under a &lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Add-buttons-to-your-flow/ta-p/13129" target="_blank" rel="noopener"&gt;button&lt;/A&gt; click:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Add-buttons-to-your-flow/ta-p/13129" target="_blank" rel="noopener"&gt;Add buttons to your flow&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;Click on &lt;STRONG&gt;&lt;SPAN class=""&gt;Add a variable&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;button to add a variable when a user clicks on this button within a conversation.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;In this example, we will name the variable "pizza", under &lt;STRONG&gt;Variable&lt;/STRONG&gt;, and assign it the &lt;STRONG&gt;Value&lt;/STRONG&gt; "margherita".&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-23 at 22.32.52.png" style="width: 709px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3880i393C569F9779DBF4/image-dimensions/709x415?v=v2" width="709" height="415" role="button" title="Screenshot 2023-11-23 at 22.32.52.png" alt="Screenshot 2023-11-23 at 22.32.52.png" /&gt;&lt;/span&gt;&lt;P&gt; 4. Add another button and create a variable called "pizza" with the value of the pizza type.&lt;!--           notionvc: a0c38ca2-b5d2-45a1-9e5e-b9f5494e4bc4           --&gt;&lt;/P&gt;&lt;P&gt;&lt;!--           notionvc: d8c67915-f168-4135-8b57-45fb96d91c51           --&gt;&lt;/P&gt;&lt;P&gt;&lt;!--           notionvc: eef6fc1b-d899-4150-a147-0aed92521a77           --&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-23 at 22.36.33.png" style="width: 713px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3881iE3D76F593A008F94/image-dimensions/713x419?v=v2" width="713" height="419" role="button" title="Screenshot 2023-11-23 at 22.36.33.png" alt="Screenshot 2023-11-23 at 22.36.33.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;5. Save your changes by clicking &lt;STRONG&gt;Save&lt;/STRONG&gt;.&lt;!--           notionvc: 08b4e77e-bd66-4a16-9b36-f0d73abc7dba           --&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-23 at 22.37.22.png" style="width: 711px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3882iA4333AF68D588615/image-dimensions/711x418?v=v2" width="711" height="418" role="button" title="Screenshot 2023-11-23 at 22.37.22.png" alt="Screenshot 2023-11-23 at 22.37.22.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;6. Open the following block in your builder. In this case, we will edit the 'margherita chosen' block. Add a step and select &lt;SPAN class=""&gt;Text&lt;/SPAN&gt;. Then, &lt;A class="" href="https://community.sinch.com/t5/Chatbot/Add-variables-to-your-text-messages/ta-p/11375" target="_blank" rel="noopener noreferrer"&gt;&lt;SPAN class=""&gt;re-use your variable&lt;/SPAN&gt;&lt;/A&gt; by typing '&lt;STRONG&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;/STRONG&gt;' or clicking the ‘&lt;STRONG&gt;&lt;SPAN class=""&gt;{}&lt;/SPAN&gt;&lt;/STRONG&gt;’ button on the bottom left of the Text Message input field and selecting the created variable 'pizza'.&lt;!--           notionvc: c261f6a2-d17b-4e5e-99af-f5158bacbc59           --&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Variable (1).gif" style="width: 713px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3883i4EEA5F938CE628B8/image-dimensions/713x401?v=v2" width="713" height="401" role="button" title="Variable (1).gif" alt="Variable (1).gif" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;6. After finishing editing your message, you can click &lt;STRONG&gt;Save&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-23 at 22.48.29.png" style="width: 708px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3884iDC03D13D139C2AA5/image-dimensions/708x414?v=v2" width="708" height="414" role="button" title="Screenshot 2023-11-23 at 22.48.29.png" alt="Screenshot 2023-11-23 at 22.48.29.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;7. &lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Test-your-bot/ta-p/13296" target="_blank" rel="noopener"&gt;Test your bot&lt;/A&gt;. Your bot now remembers the customer's choice under a variable and can use it again!&lt;!--           notionvc: 53fd1caa-fc6e-427a-a356-577d5edfa427           --&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2023-11-23 at 22.49.30.png" style="width: 301px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3885i73FC6BF4CCEA2DF4/image-dimensions/301x686?v=v2" width="301" height="686" role="button" title="Screenshot 2023-11-23 at 22.49.30.png" alt="Screenshot 2023-11-23 at 22.49.30.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See also:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Collect-input/ta-p/13186" target="_blank" rel="noopener"&gt;[New bot builder] Collect input&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Add-buttons-to-your-flow/ta-p/13129" target="_blank" rel="noopener"&gt;[New bot builder] Add buttons to your bot&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Variables-and-properties/ta-p/12280" target="_blank" rel="noopener"&gt;[New bot builder] Variables and properties&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--           notionvc: 46cc9763-0508-4e10-ac98-7e56c5fd7ca5           --&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 02 Jan 2024 12:27:24 GMT</pubDate>
    <dc:creator>Agatha_Morisca</dc:creator>
    <dc:date>2024-01-02T12:27:24Z</dc:date>
    <item>
      <title>Save a variable under a button click</title>
      <link>https://community.sinch.com/t5/Chatbot/Save-a-variable-under-a-button-click/ta-p/13176</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;&lt;P&gt;You can save &lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Variables-and-properties/ta-p/12280" target="_blank" rel="noopener"&gt;variables&lt;/A&gt; under button clicks if you're using a button step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To save a &lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Variables-and-properties/ta-p/12280" target="_blank" rel="noopener"&gt;variable&lt;/A&gt; under a &lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Add-buttons-to-your-flow/ta-p/13129" target="_blank" rel="noopener"&gt;button&lt;/A&gt; click:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Add-buttons-to-your-flow/ta-p/13129" target="_blank" rel="noopener"&gt;Add buttons to your flow&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;Click on &lt;STRONG&gt;&lt;SPAN class=""&gt;Add a variable&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;button to add a variable when a user clicks on this button within a conversation.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;In this example, we will name the variable "pizza", under &lt;STRONG&gt;Variable&lt;/STRONG&gt;, and assign it the &lt;STRONG&gt;Value&lt;/STRONG&gt; "margherita".&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-23 at 22.32.52.png" style="width: 709px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3880i393C569F9779DBF4/image-dimensions/709x415?v=v2" width="709" height="415" role="button" title="Screenshot 2023-11-23 at 22.32.52.png" alt="Screenshot 2023-11-23 at 22.32.52.png" /&gt;&lt;/span&gt;&lt;P&gt; 4. Add another button and create a variable called "pizza" with the value of the pizza type.&lt;!--           notionvc: a0c38ca2-b5d2-45a1-9e5e-b9f5494e4bc4           --&gt;&lt;/P&gt;&lt;P&gt;&lt;!--           notionvc: d8c67915-f168-4135-8b57-45fb96d91c51           --&gt;&lt;/P&gt;&lt;P&gt;&lt;!--           notionvc: eef6fc1b-d899-4150-a147-0aed92521a77           --&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-23 at 22.36.33.png" style="width: 713px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3881iE3D76F593A008F94/image-dimensions/713x419?v=v2" width="713" height="419" role="button" title="Screenshot 2023-11-23 at 22.36.33.png" alt="Screenshot 2023-11-23 at 22.36.33.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;5. Save your changes by clicking &lt;STRONG&gt;Save&lt;/STRONG&gt;.&lt;!--           notionvc: 08b4e77e-bd66-4a16-9b36-f0d73abc7dba           --&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-23 at 22.37.22.png" style="width: 711px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3882iA4333AF68D588615/image-dimensions/711x418?v=v2" width="711" height="418" role="button" title="Screenshot 2023-11-23 at 22.37.22.png" alt="Screenshot 2023-11-23 at 22.37.22.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;6. Open the following block in your builder. In this case, we will edit the 'margherita chosen' block. Add a step and select &lt;SPAN class=""&gt;Text&lt;/SPAN&gt;. Then, &lt;A class="" href="https://community.sinch.com/t5/Chatbot/Add-variables-to-your-text-messages/ta-p/11375" target="_blank" rel="noopener noreferrer"&gt;&lt;SPAN class=""&gt;re-use your variable&lt;/SPAN&gt;&lt;/A&gt; by typing '&lt;STRONG&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;/STRONG&gt;' or clicking the ‘&lt;STRONG&gt;&lt;SPAN class=""&gt;{}&lt;/SPAN&gt;&lt;/STRONG&gt;’ button on the bottom left of the Text Message input field and selecting the created variable 'pizza'.&lt;!--           notionvc: c261f6a2-d17b-4e5e-99af-f5158bacbc59           --&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Variable (1).gif" style="width: 713px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3883i4EEA5F938CE628B8/image-dimensions/713x401?v=v2" width="713" height="401" role="button" title="Variable (1).gif" alt="Variable (1).gif" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;6. After finishing editing your message, you can click &lt;STRONG&gt;Save&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-11-23 at 22.48.29.png" style="width: 708px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3884iDC03D13D139C2AA5/image-dimensions/708x414?v=v2" width="708" height="414" role="button" title="Screenshot 2023-11-23 at 22.48.29.png" alt="Screenshot 2023-11-23 at 22.48.29.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;7. &lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Test-your-bot/ta-p/13296" target="_blank" rel="noopener"&gt;Test your bot&lt;/A&gt;. Your bot now remembers the customer's choice under a variable and can use it again!&lt;!--           notionvc: 53fd1caa-fc6e-427a-a356-577d5edfa427           --&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screenshot 2023-11-23 at 22.49.30.png" style="width: 301px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/3885i73FC6BF4CCEA2DF4/image-dimensions/301x686?v=v2" width="301" height="686" role="button" title="Screenshot 2023-11-23 at 22.49.30.png" alt="Screenshot 2023-11-23 at 22.49.30.png" /&gt;&lt;/span&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See also:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Collect-input/ta-p/13186" target="_blank" rel="noopener"&gt;[New bot builder] Collect input&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Add-buttons-to-your-flow/ta-p/13129" target="_blank" rel="noopener"&gt;[New bot builder] Add buttons to your bot&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sinch.com/t5/Chatbot/New-bot-builder-Variables-and-properties/ta-p/12280" target="_blank" rel="noopener"&gt;[New bot builder] Variables and properties&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;!--           notionvc: 46cc9763-0508-4e10-ac98-7e56c5fd7ca5           --&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 02 Jan 2024 12:27:24 GMT</pubDate>
      <guid>https://community.sinch.com/t5/Chatbot/Save-a-variable-under-a-button-click/ta-p/13176</guid>
      <dc:creator>Agatha_Morisca</dc:creator>
      <dc:date>2024-01-02T12:27:24Z</dc:date>
    </item>
  </channel>
</rss>

