<?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>How to save a Array into a Local Variable/RI at a Specific Index?</title><link>https://community.appian.com/discussions/f/user-interface/22958/how-to-save-a-array-into-a-local-variable-ri-at-a-specific-index</link><description>The idea that I want to do is be able to save a specific answer into a specific spot into an array. I want to be able to select multiple drop downs save it into one array and then put that in the CDT to be referenced. I do not want to use a multiple dropdown</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to save a Array into a Local Variable/RI at a Specific Index?</title><link>https://community.appian.com/thread/89019?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 15:55:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:684ea5ac-67e3-4467-b74c-88aa868b02f7</guid><dc:creator>Kyle G</dc:creator><description>&lt;p&gt;You are a godsend thank you so much this worked perfectly. I dont think I ever connected that the problems was mismatching types&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to save a Array into a Local Variable/RI at a Specific Index?</title><link>https://community.appian.com/thread/89018?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 15:51:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aa38ded6-df1c-4509-aadd-17c23c41d8f9</guid><dc:creator>prasathp0001</dc:creator><description>&lt;p&gt;The type of the choice values &amp;amp; the Value is different&lt;/p&gt;
&lt;p&gt;typename(typeof(local!pubProd[1])) --&amp;gt; using this you can confirm the data types is different(use this for future findings)&lt;/p&gt;
&lt;p&gt;the choice values - integer type&amp;nbsp; (but)&lt;/p&gt;
&lt;p&gt;local!dataProd1[fv!index] is returning text type&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So cast() both choice values and the value as same datatype&amp;nbsp;or in simple you can try this&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tointeger(local!dataProd1[fv!index])&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to save a Array into a Local Variable/RI at a Specific Index?</title><link>https://community.appian.com/thread/89015?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 15:38:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:359db3fb-910c-47f3-8a5e-95ea80ba4b22</guid><dc:creator>Kyle G</dc:creator><description>&lt;p&gt;How would you recommend I implement this?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to save a Array into a Local Variable/RI at a Specific Index?</title><link>https://community.appian.com/thread/89014?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 15:35:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d9ac237-7333-41e3-b91d-9cab89290a93</guid><dc:creator>prasathp0001</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Try the &lt;strong&gt;updatearray&lt;/strong&gt;() function to update the specific index value in an array,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/21.4/fnc_array_updatearray.html"&gt;updatearray() Function - Appian 21.4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;updatearray&lt;/strong&gt;&lt;span&gt;(&amp;nbsp;&lt;/span&gt;&lt;em&gt;array, index, value&lt;/em&gt;&lt;span&gt;&amp;nbsp;) for the &lt;strong&gt;index&lt;/strong&gt; if you use the wherecontains() fn - which will help you to locate the index for the given value to update&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to save a Array into a Local Variable/RI at a Specific Index?</title><link>https://community.appian.com/thread/89013?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 15:34:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:250dc16f-7715-4f13-9db9-be7e0424f505</guid><dc:creator>Kyle G</dc:creator><description>&lt;p&gt;Update:&lt;br /&gt;&lt;br /&gt;If I predefine it like this:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;  local!pubProd: repeat(4, null),
  local!dataProd1: repeat(4, null),&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;it works well except for the error I get which is:&lt;br /&gt;&lt;strong class="StrongText---richtext_strong StrongText---inMessageLayout StrongText---error"&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong class="StrongText---richtext_strong StrongText---inMessageLayout StrongText---error"&gt;Could not display interface. Please check definition and inputs.&lt;/strong&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;Interface Definition: Expression evaluation error at function a!forEach [line 9]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function a!dropdownField [line 16]: A dropdown component [label="Producing Organization"] has an invalid value for &amp;quot;value&amp;quot;. All selected values must be present in the choiceValues array, but value was 1 and choiceValues was 1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to save a Array into a Local Variable/RI at a Specific Index?</title><link>https://community.appian.com/thread/89012?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 15:04:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0332f505-4d4e-4f9d-9fe6-eef76d6b19dd</guid><dc:creator>Kyle G</dc:creator><description>&lt;p&gt;I am not too sure where I would put the a!update function. I tried putting it in the saveInto but that doesnt seem to work how I want it too.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to save a Array into a Local Variable/RI at a Specific Index?</title><link>https://community.appian.com/thread/89011?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 14:59:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bda6a317-8a8a-4fe1-9336-a3003f6c494b</guid><dc:creator>hrishikeshd997</dc:creator><description>&lt;p&gt;Have you tried using the a!update() function within saveInto? Here is the documentation link for it&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;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>