<?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 attribute within a!update() function seems to be case insensitive</title><link>https://community.appian.com/discussions/f/rules/22718/index-attribute-within-a-update-function-seems-to-be-case-insensitive</link><description>We often use a!update() function to update dictionary values however, it fails when a dictionary has 2 attributes with different font cases (e.g. label &amp;amp; LABEL) 
 In 21.4 I tried using the a!update() function as below: 
 Input : 
 { label:&amp;quot;&amp;quot;, LABEL:&amp;quot;asdf</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Index attribute within a!update() function seems to be case insensitive</title><link>https://community.appian.com/thread/88839?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 05:14:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ea9df955-3b6d-4371-8296-49287f5a7b7c</guid><dc:creator>ajhick</dc:creator><description>&lt;p&gt;If you don&amp;#39;t care about the order of your dictionary you can use the below code. This was just a quick formulation so if the order is important I&amp;#39;m sure this could be achieved as well as validation checks to see if a!update() would work. But this at least proves the concept.&lt;/p&gt;
&lt;p&gt;Appian is a little inconsistent with what is and isn&amp;#39;t case sensitive. For example if you&amp;#39;re checking for a valid username before creating a user using the isusernametaken() function then this is case sensitive. But account creation is case insensitive so if you check for &amp;quot;Appian&amp;quot; and it&amp;#39;s available your user creation may still fail if there is a user &amp;quot;appian&amp;quot; (or any permutation where only the case differs). Frustrating.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: {
    label:&amp;quot;&amp;quot;,
    LABEL:&amp;quot;asdf&amp;quot;,
    label3:&amp;quot;&amp;quot;,
    label4:&amp;quot;asdf&amp;quot;
  },
  local!fieldToUpdate: &amp;quot;LABEL&amp;quot;,
  local!newValue: 123,
  insert(
    remove(
      local!data,
      local!fieldToUpdate
    ),
    local!newValue,
    local!fieldToUpdate
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1639026602637v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index attribute within a!update() function seems to be case insensitive</title><link>https://community.appian.com/thread/88834?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 01:57:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ff06dfa2-3a56-4b76-a0fe-6fc3da4ab572</guid><dc:creator>hrishikeshd997</dc:creator><description>&lt;p&gt;Based on the documentation, this is a limitation of a!update() function.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/21.4/fnc_array_a_update.html"&gt;https://docs.appian.com/suite/help/21.4/fnc_array_a_update.html&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="limitations-and-alternatives"&gt;Limitations and alternatives&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Do not use maps, dictionaries, CDTs, or records which contain fields that differ only in casing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can use updateDictionary() function from the&amp;nbsp;&amp;quot;Dictionary Manipulation&amp;quot; plugin which gives the desired result.&lt;/p&gt;
&lt;p&gt;&lt;a href="/b/appmarket/posts/cdt-manipulation"&gt;https://community.appian.com/b/appmarket/posts/cdt-manipulation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;updatedictionary(
  dictionary:  ri!dict,
  fieldsAndValues: {
    &amp;quot;LABEL&amp;quot;: 123
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Index attribute within a!update() function seems to be case insensitive</title><link>https://community.appian.com/thread/88833?ContentTypeID=1</link><pubDate>Thu, 09 Dec 2021 01:03:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:178fe71a-7d99-4d0d-8a9f-9fc99dc6e4a4</guid><dc:creator>TJ</dc:creator><description>&lt;p&gt;I am specifically using dictionary type (and not MAP type) to avoid getting the duplicate label error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>