<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Unintuitive If() behaviour</title><link>https://community.appian.com/discussions/f/general/34124/unintuitive-if-behaviour</link><description>Current Behaviour: 
 
 
 
 
 Given the above code when the local!test value is {1} the output is {&amp;quot;My First Message&amp;quot;} 
 when the local!test value is {1,2} the output is {&amp;quot;My First Message&amp;quot;, &amp;quot;My second Message&amp;quot;} 
 when the local!test value is {1,2,3,4</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Unintuitive If() behaviour</title><link>https://community.appian.com/thread/129970?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 13:35:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5f965d9c-46fd-45e1-b5f1-e9ff4d254ff7</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;a!match seems to handle it better IMO. If you pass it a list, the condition never triggers.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!test: {},
  a!match(
    value: local!test,
    whenTrue: local!test &amp;gt; 0,
    then: {
      &amp;quot;My First Message&amp;quot;,
      &amp;quot;My second Message&amp;quot;,
      &amp;quot;My third message&amp;quot;
    },
    default: &amp;quot;My false Message&amp;quot;
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unintuitive If() behaviour</title><link>https://community.appian.com/thread/129897?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 06:16:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b65097eb-6d2d-4688-8f89-dffaf0745332</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I think this is dangerous as the behaviour of an if() with multiple conditions is hard to predict and combined with variable length values lists becomes erratic at best.&lt;/p&gt;
&lt;p&gt;&lt;a href="/members/april.schuppel"&gt;April Schuppel&lt;/a&gt;&amp;nbsp;if the docs team is updating this, I suggest to include a clear warning about the edge cases and that the if() function clearly is &lt;strong&gt;meant&lt;/strong&gt; to be used with a single condition only.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unintuitive If() behaviour</title><link>https://community.appian.com/thread/129891?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 02:14:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e17a9e52-d338-4b7b-91ac-aad1eb632b06</guid><dc:creator>April Schuppel</dc:creator><description>&lt;p&gt;Interesting point - I can bring it up with the docs team!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unintuitive If() behaviour</title><link>https://community.appian.com/thread/129890?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 02:12:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8a5395ee-8ba1-4354-a3cb-e30b6f79ef7e</guid><dc:creator>deans4069</dc:creator><description>&lt;p&gt;Should this be updated since condition can be a list of boolean and not just the data type boolean?&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1708567293547v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unintuitive If() behaviour</title><link>https://community.appian.com/thread/129886?ContentTypeID=1</link><pubDate>Thu, 22 Feb 2024 01:41:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7eaab917-dfd1-4076-a184-132510e0707c</guid><dc:creator>April Schuppel</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/deans4069"&gt;deans4069&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/23.4/fnc_logical_if.html#lists-of-values"&gt;if() function docs&lt;/a&gt;&amp;nbsp;explain this behavior: &amp;quot;&lt;span&gt;However, if the value parameters have shorter lists than the&amp;nbsp;&lt;/span&gt;&lt;em&gt;condition&lt;/em&gt;&lt;span&gt;, the index is not maintained. Instead, each item is returned in order (and repeats if necessary).&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>