<?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 If-Else conditions in Legacy - Engage Bot</title>
    <link>https://community.sinch.com/t5/Legacy-Engage-Bot/If-Else-conditions/ta-p/19168</link>
    <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P class="text-align-justify"&gt;With the condition function you can define rules for the Bot answers. In this way you can create different messages for different messenger types.&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify" data-unlink="true"&gt;By clicking on the button +Condition you can set up new conditions for bot answers.&amp;nbsp;With the condition function you can define rules for the Bot answers, for instance by comparing current value of a variable with another value. For instance, in this way you can create different messages for different messenger types. The first condition in our example here compared current value of a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;system variable&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;$profile_messenger$ to an abbreviation "WB" to check whether profile messenger of a user is WhatsApp. If not true, the bot will check the second condition which does a similar comparison for Facebook Messenger.&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9.png" style="width: 999px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7020iFFD426628B91A48F/image-size/large?v=v2&amp;amp;px=999" role="button" title="9.png" alt="9.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H5 class="text-align-justify"&gt;&lt;FONT size="5"&gt;Conditions in details&lt;/FONT&gt;&lt;/H5&gt;
&lt;P class="text-align-justify" data-unlink="true"&gt;&lt;STRONG&gt;1)&amp;nbsp;Variables&amp;nbsp;are often user to create conditions.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;Variables are typed with the dollar symbol before and after the variable name, for example: $profile_messenger$. A few variables have already been pre-set, and will appear when you type in a dollar sign. If you set your own variables, they will also appear in this selection.&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify" data-unlink="true"&gt;&lt;STRONG&gt;2)&amp;nbsp;The rules for Bot answers are defined through operators and&amp;nbsp;functions.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;Possible operators are:&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-02-13 at 09.43.14.png" style="width: 999px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7021iEA385B30C0EC73DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-02-13 at 09.43.14.png" alt="Screenshot 2026-02-13 at 09.43.14.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&lt;STRONG&gt;3) You can structure conditions with parentheses ().&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;You may need to create a structure when there are a variety of conditions with logical operators.&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-02-13 at 09.43.56.png" style="width: 999px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7022i35F60871DCBD5570/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-02-13 at 09.43.56.png" alt="Screenshot 2026-02-13 at 09.43.56.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;–&amp;gt;&amp;nbsp; if a profile messenger is telegram or facebook messenger and a variable customer number is not empty&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify" data-unlink="true"&gt;&lt;STRONG&gt;4)&amp;nbsp;There is a variety of possible functions that you can use to create different conditions (see also the&amp;nbsp;complete function reference &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="text-align-justify"&gt;Modulo-Operator: gives you the result of a division&lt;EM&gt;&amp;nbsp;x%y === Rest&lt;/EM&gt;&amp;nbsp;(x, y, and Rest are numbers)&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Recognition of relative dates like yesterday(), today(), tomorrow()&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Recognition of weekdays: weekday()&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Recognition of relative dates that refer to specific day of the month, like first_day_of("Name of the Month")&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Calculation and comparison of values in conjunction with mathematic and comparative operators&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Listing of times (in seconds) on a date value&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Recognition of the length of a chain of numbers&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H5 class="text-align-justify"&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;Examples:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H5&gt;
&lt;UL&gt;
&lt;LI class="text-align-justify"&gt;Combinationed condition:&lt;STRONG&gt;&amp;nbsp;$profile_messenger$ == "&lt;/STRONG&gt;&lt;STRONG&gt;WB"&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;and $Interest$ == "&lt;/STRONG&gt;&lt;STRONG&gt;Sport"&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;No preferences have been set yet:&amp;nbsp;&lt;STRONG&gt;$Interest$ != ""&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Several combined conditions:&amp;nbsp;&lt;STRONG&gt;$profile_messenger$ == "WB" and ($interest$ == "mountainbike" or $interest$ == "racebike")&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Compare today’s date with a specific date:&amp;nbsp;&lt;STRONG&gt;today() == 01.01.2018&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Compare the current time to the set time of a user property:&lt;STRONG&gt;&amp;nbsp;(now()-today()) &amp;lt; to_seconds("12:00")&amp;nbsp;&lt;/STRONG&gt;(is&amp;nbsp;it&amp;nbsp;forenoon?)&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;It is X-weekday:&lt;STRONG&gt;&amp;nbsp;weekday() == 1&amp;nbsp;&lt;/STRONG&gt;checks if today is Monday;&amp;nbsp;&lt;STRONG&gt;weekday() == 2&amp;nbsp;&lt;/STRONG&gt;checks if today is Tuesday; etc.&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Modulus: variables with number values will be calculated and the remaining value will be checked:&amp;nbsp;&lt;STRONG&gt;($Variable1$ + $variable2$) % 2 == 1&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Message should be sent if the password is the incorrect length:&amp;nbsp;&lt;STRONG&gt;length($PW$)!08&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Only weekend:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;weekday() &amp;gt; 5&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Certain day of a month: zB.&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;day() == 24 and month() == 12&lt;/STRONG&gt;&amp;nbsp;(prüft ob heute 24.12 ist).&lt;/LI&gt;
&lt;LI&gt;Monday to Friday from 8 to 17:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;today() &amp;lt; 6 and now()-today() &amp;gt; to_seconds("08:00") and now() – today() &amp;lt; to_seconds("17:00")&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Monday to Friday before 8 and after 17:&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;today() &amp;lt; 6 and (now()-today() &amp;lt; to_seconds("08:00") or now() – today() &amp;gt; to_seconds("17:00"))&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 19 Feb 2026 15:22:17 GMT</pubDate>
    <dc:creator>VishalSandhu</dc:creator>
    <dc:date>2026-02-19T15:22:17Z</dc:date>
    <item>
      <title>If-Else conditions</title>
      <link>https://community.sinch.com/t5/Legacy-Engage-Bot/If-Else-conditions/ta-p/19168</link>
      <description>&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;P class="text-align-justify"&gt;With the condition function you can define rules for the Bot answers. In this way you can create different messages for different messenger types.&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify" data-unlink="true"&gt;By clicking on the button +Condition you can set up new conditions for bot answers.&amp;nbsp;With the condition function you can define rules for the Bot answers, for instance by comparing current value of a variable with another value. For instance, in this way you can create different messages for different messenger types. The first condition in our example here compared current value of a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;system variable&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;$profile_messenger$ to an abbreviation "WB" to check whether profile messenger of a user is WhatsApp. If not true, the bot will check the second condition which does a similar comparison for Facebook Messenger.&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="9.png" style="width: 999px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7020iFFD426628B91A48F/image-size/large?v=v2&amp;amp;px=999" role="button" title="9.png" alt="9.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H5 class="text-align-justify"&gt;&lt;FONT size="5"&gt;Conditions in details&lt;/FONT&gt;&lt;/H5&gt;
&lt;P class="text-align-justify" data-unlink="true"&gt;&lt;STRONG&gt;1)&amp;nbsp;Variables&amp;nbsp;are often user to create conditions.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;Variables are typed with the dollar symbol before and after the variable name, for example: $profile_messenger$. A few variables have already been pre-set, and will appear when you type in a dollar sign. If you set your own variables, they will also appear in this selection.&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify" data-unlink="true"&gt;&lt;STRONG&gt;2)&amp;nbsp;The rules for Bot answers are defined through operators and&amp;nbsp;functions.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;Possible operators are:&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-02-13 at 09.43.14.png" style="width: 999px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7021iEA385B30C0EC73DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-02-13 at 09.43.14.png" alt="Screenshot 2026-02-13 at 09.43.14.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&lt;STRONG&gt;3) You can structure conditions with parentheses ().&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;You may need to create a structure when there are a variety of conditions with logical operators.&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-02-13 at 09.43.56.png" style="width: 999px;"&gt;&lt;img src="https://community.sinch.com/t5/image/serverpage/image-id/7022i35F60871DCBD5570/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-02-13 at 09.43.56.png" alt="Screenshot 2026-02-13 at 09.43.56.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P class="text-align-justify"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;–&amp;gt;&amp;nbsp; if a profile messenger is telegram or facebook messenger and a variable customer number is not empty&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="text-align-justify" data-unlink="true"&gt;&lt;STRONG&gt;4)&amp;nbsp;There is a variety of possible functions that you can use to create different conditions (see also the&amp;nbsp;complete function reference &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="text-align-justify"&gt;Modulo-Operator: gives you the result of a division&lt;EM&gt;&amp;nbsp;x%y === Rest&lt;/EM&gt;&amp;nbsp;(x, y, and Rest are numbers)&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Recognition of relative dates like yesterday(), today(), tomorrow()&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Recognition of weekdays: weekday()&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Recognition of relative dates that refer to specific day of the month, like first_day_of("Name of the Month")&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Calculation and comparison of values in conjunction with mathematic and comparative operators&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Listing of times (in seconds) on a date value&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Recognition of the length of a chain of numbers&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H5 class="text-align-justify"&gt;&lt;STRONG&gt;&lt;FONT size="4"&gt;Examples:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H5&gt;
&lt;UL&gt;
&lt;LI class="text-align-justify"&gt;Combinationed condition:&lt;STRONG&gt;&amp;nbsp;$profile_messenger$ == "&lt;/STRONG&gt;&lt;STRONG&gt;WB"&lt;/STRONG&gt;&lt;STRONG&gt;&amp;nbsp;and $Interest$ == "&lt;/STRONG&gt;&lt;STRONG&gt;Sport"&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;No preferences have been set yet:&amp;nbsp;&lt;STRONG&gt;$Interest$ != ""&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Several combined conditions:&amp;nbsp;&lt;STRONG&gt;$profile_messenger$ == "WB" and ($interest$ == "mountainbike" or $interest$ == "racebike")&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Compare today’s date with a specific date:&amp;nbsp;&lt;STRONG&gt;today() == 01.01.2018&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Compare the current time to the set time of a user property:&lt;STRONG&gt;&amp;nbsp;(now()-today()) &amp;lt; to_seconds("12:00")&amp;nbsp;&lt;/STRONG&gt;(is&amp;nbsp;it&amp;nbsp;forenoon?)&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;It is X-weekday:&lt;STRONG&gt;&amp;nbsp;weekday() == 1&amp;nbsp;&lt;/STRONG&gt;checks if today is Monday;&amp;nbsp;&lt;STRONG&gt;weekday() == 2&amp;nbsp;&lt;/STRONG&gt;checks if today is Tuesday; etc.&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Modulus: variables with number values will be calculated and the remaining value will be checked:&amp;nbsp;&lt;STRONG&gt;($Variable1$ + $variable2$) % 2 == 1&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Message should be sent if the password is the incorrect length:&amp;nbsp;&lt;STRONG&gt;length($PW$)!08&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Only weekend:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;weekday() &amp;gt; 5&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI class="text-align-justify"&gt;Certain day of a month: zB.&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;day() == 24 and month() == 12&lt;/STRONG&gt;&amp;nbsp;(prüft ob heute 24.12 ist).&lt;/LI&gt;
&lt;LI&gt;Monday to Friday from 8 to 17:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;today() &amp;lt; 6 and now()-today() &amp;gt; to_seconds("08:00") and now() – today() &amp;lt; to_seconds("17:00")&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Monday to Friday before 8 and after 17:&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;today() &amp;lt; 6 and (now()-today() &amp;lt; to_seconds("08:00") or now() – today() &amp;gt; to_seconds("17:00"))&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 19 Feb 2026 15:22:17 GMT</pubDate>
      <guid>https://community.sinch.com/t5/Legacy-Engage-Bot/If-Else-conditions/ta-p/19168</guid>
      <dc:creator>VishalSandhu</dc:creator>
      <dc:date>2026-02-19T15:22:17Z</dc:date>
    </item>
  </channel>
</rss>

