<?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>Bug Appian 18.2 SaveInto doesen&amp;#39;t accept array</title><link>https://community.appian.com/discussions/f/rules/13302/bug-appian-18-2-saveinto-doesen-t-accept-array</link><description>Hi all, 
 In previous Appian Version 17.2 is possible to insert an array in the saveInto Expression of a field (See below Sail) 
 
 saveInto: { ri!gridSelection, if( rule!APN_isEmpty(ri!gridSelection.selected), a!save( ri!titoliSelezionati, {} ), a!forEach</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Bug Appian 18.2 SaveInto doesen't accept array</title><link>https://community.appian.com/thread/60163?ContentTypeID=1</link><pubDate>Mon, 10 Sep 2018 20:41:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:61b7756e-10ad-4c5e-9f3d-b304498bcee8</guid><dc:creator>Sik-Kim</dc:creator><description>&lt;p&gt;Whether or not this is a bug, I don&amp;#39;t think using an a!forEach is even necessary in the code you provided.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no reason to be executing&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!save(
    ri!titoliSelezionati.vendita,
    &amp;quot;Parziale&amp;quot;
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;for each item in the list of selections, since you&amp;#39;re just saving the same value over and over.&lt;/p&gt;
&lt;p&gt;The forEach also looks like you&amp;#39;re rebuilding an entire list (ri!titoliSelezionati) from scratch each time someone selects a new item in the grid. Although this might be easier, an arguably better approach is to figure out which item was added/removed and then do the processing on that item alone. You can do this by comparing your existing list (ri!titoliSelezionati), with the new list (save!value). This would&amp;nbsp;improve the scalability of your solution, if that is a concern.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug Appian 18.2 SaveInto doesen't accept array</title><link>https://community.appian.com/thread/60162?ContentTypeID=1</link><pubDate>Mon, 10 Sep 2018 19:26:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8e7633f9-891b-44e4-a7f0-500e9d0311c4</guid><dc:creator>jerrys790</dc:creator><description>Are you looking for a way around this to save your values?  I also have never use a!save inside a forEach loop.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug Appian 18.2 SaveInto doesen't accept array</title><link>https://community.appian.com/thread/60142?ContentTypeID=1</link><pubDate>Mon, 10 Sep 2018 12:12:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e350da67-3c99-479a-b77b-9290259398d5</guid><dc:creator>marcoc918</dc:creator><description>Yes multiple values(array) are accepted in savaInto as you said but is not accepted an array of a!save inside an a!forEach &lt;br /&gt;
&lt;br /&gt;
es:&lt;br /&gt;
&lt;br /&gt;
saveInto: {a!save(ri!input,1),(ri!input2,2)} is ok&lt;br /&gt;
&lt;br /&gt;
saveInto: {a!foreach(items: ri!array/*{1,2}*/, expression: {a!save(ri!input1,fv!item), a!save(ri!input2, fv!item)})} is not accepted&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug Appian 18.2 SaveInto doesen't accept array</title><link>https://community.appian.com/thread/60137?ContentTypeID=1</link><pubDate>Mon, 10 Sep 2018 11:18:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ddc1a8b1-c55e-47ed-be57-dbb8af7ff7fe</guid><dc:creator>sagarl511</dc:creator><description>I have never used a!save in foreach as I feel the best practice is to format the data array first and then use a!save to save into any variable.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bug Appian 18.2 SaveInto doesen't accept array</title><link>https://community.appian.com/thread/60136?ContentTypeID=1</link><pubDate>Mon, 10 Sep 2018 11:11:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:04344bfe-8b91-4a9e-9be2-8829106193cb</guid><dc:creator>melwyna</dc:creator><description>Hi,&lt;br /&gt;
&lt;br /&gt;
I didn&amp;#39;t understand the above context completely.&lt;br /&gt;
But we can save multiple values(array) in SaveInto from selection.&lt;br /&gt;
&lt;br /&gt;
value:ri!gridselection,&lt;br /&gt;
saveInto:&lt;br /&gt;
{&lt;br /&gt;
ri!gridselection,&lt;br /&gt;
a!save(ri!selectedID,ri!gridselection.selected)&lt;br /&gt;
} &lt;br /&gt;
If you select multiple data from grid, those ID&amp;#39;s will get saved in array &lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Melwyn J&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>