<?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>index() and property() function failure</title><link>https://community.appian.com/discussions/f/general/23560/index-and-property-function-failure</link><description>Hello there, 
 I&amp;#39;ve used the index() and property() function for years to pull from CDTs and dictionaries however I&amp;#39;ve recently run into a problem where both functions are no longer working as expected. Am I crazy here or is there something else going</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: index() and property() function failure</title><link>https://community.appian.com/thread/90310?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 19:02:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6215cc89-51e7-44f3-b464-f786b8ae7289</guid><dc:creator>Jin Pheh</dc:creator><description>&lt;p&gt;Agreed, along with a specific timeframe around when the change was introduced.&amp;nbsp; Regression testing this is going to be a PITA and (potentially) explains a whole series of &amp;quot;WTF&amp;quot; bugs I&amp;#39;ve run into over the past several months.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Eg: A similar post about a change in behavior from a year ago is almost certainly associated with the same change.&amp;nbsp;&lt;a class="c-link" href="/discussions/f/rules/19895/has-the-index-function-changed-recently/77733#77733" rel="noopener noreferrer" target="_blank"&gt;https://community.appian.com/discussions/f/rules/19895/has-the-index-function-changed-recently/77733#77733&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: index() and property() function failure</title><link>https://community.appian.com/thread/90309?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 19:00:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c44b948c-779c-4f82-b36e-1bdecf2269b7</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;I can agree on the annoyance, it has caught quite a few people by surprise.&lt;/p&gt;
&lt;p&gt;I know the documentation was updated recently to be more thorough, but I can reproduce this same behavior on my 21.1 environment - would have to defer to Appian as far as when/if any related functionality might have changed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: index() and property() function failure</title><link>https://community.appian.com/thread/90308?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 18:55:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3da26412-48d0-4860-898b-446ece2fd5d9</guid><dc:creator>Jin Pheh</dc:creator><description>&lt;p&gt;Hmm.. Right you are Chris - it says so clear as day in the current documentation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I find it &lt;strong&gt;very&lt;/strong&gt; annoying though because this change was (apparently) introduced in 21.3 and was NOT mentioned in the release notes for 21.3 or any version since.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: index() and property() function failure</title><link>https://community.appian.com/thread/90307?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 18:50:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3fc0d9e4-efe2-44dc-ba1d-6de487dc5715</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;This is actually documented functionality for the &lt;a href="https://docs.appian.com/suite/help/21.4/fnc_array_index.html"&gt;index() function.&lt;/a&gt;&amp;nbsp; When the data is a &lt;em&gt;&lt;strong&gt;dictionary&lt;/strong&gt;&lt;/em&gt;, the default is ignored and null is returned.&lt;/p&gt;
&lt;p&gt;Utilize a!map to obtain better results:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;fn!index(a!map(startYear: 2022), &amp;quot;YogiBear&amp;quot;, &amp;quot;999&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;fn!index:&lt;/p&gt;
&lt;h2 id="usage-considerations"&gt;Usage considerations&lt;/h2&gt;
&lt;p&gt;The type of the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;default&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;value must be same as that of the elements in the array.&lt;/p&gt;
&lt;p&gt;When the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;data&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is a dictionary, if the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;index&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;is not found in the dictionary, the&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;em&gt;default&lt;/em&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;will be ignored and a null value will be returned. Consider using a&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.appian.com/suite/help/21.4/fnc_system_map.html"&gt;map&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;instead of a dictionary.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>