<?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>issue with reject(fn!isnull, &amp;#39;array of arrays&amp;#39;) function on a data generated from an expression rule</title><link>https://community.appian.com/discussions/f/data/14075/issue-with-reject-fn-isnull-array-of-arrays-function-on-a-data-generated-from-an-expression-rule</link><description>Hi Community, 
 I have a strange problem with the reject function. I am getting an error when I work with the data generated with my expression rule. If I do a copy &amp;amp; paste of the data generated, the function does not give me an error but I am not getting</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: issue with reject(fn!isnull, 'array of arrays') function on a data generated from an expression rule</title><link>https://community.appian.com/thread/63798?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 10:44:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f92cba89-9ecc-4638-a8c7-bcbd99744e03</guid><dc:creator>ManuelHTG</dc:creator><description>&lt;p&gt;Thanks for the Idea, but it is not the right solution. For reaching that solution the best would be to use &lt;em&gt;touniformstring() &lt;/em&gt;and then the reject function. The problem there is that then I get a flat array, which does not work for the graphical representation of the pie chart.&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Rather than having and Index, the solution was to make it a datasubset.&lt;/p&gt;
&lt;p&gt;Thanks for the suggestion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: issue with reject(fn!isnull, 'array of arrays') function on a data generated from an expression rule</title><link>https://community.appian.com/thread/63797?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 10:40:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:46cb1b53-4c21-45cf-b6e1-9de12c81b22c</guid><dc:creator>ManuelHTG</dc:creator><description>&lt;p&gt;Thank you very much, that way worked for the reject function! &lt;/p&gt;
&lt;p&gt;first I store on a local variable and call: &amp;nbsp;&amp;nbsp;&lt;em&gt; local!aux.data&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Then I get:&lt;/p&gt;
&lt;div class="FieldLayout---input_column"&gt;
&lt;p class="ParagraphText---richtext_paragraph ParagraphText---default_direction ParagraphText---align_start elements---global_p"&gt;&lt;span style="color:#0000ff;"&gt;{null, null, null, null, null, null, null, null, {name: &amp;quot;Outbound&amp;quot;, count: 1}, null, {name: &amp;quot;Mudcakes&amp;quot;, count: 2}, {name: &amp;quot;Happy Industries&amp;quot;, count: 2}, null, null}&lt;/span&gt;&lt;/p&gt;
&lt;p class="ParagraphText---richtext_paragraph ParagraphText---default_direction ParagraphText---align_start elements---global_p"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#000000;"&gt;Now I can call reject()&lt;em&gt; : &amp;nbsp;&amp;nbsp;&amp;nbsp; reject(fn!isnull,local!aux.data) &lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="ParagraphText---richtext_paragraph ParagraphText---default_direction ParagraphText---align_start elements---global_p"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#000000;"&gt;And then I get:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class="FieldLayout---label_column FieldLayout---near"&gt;&amp;nbsp;{{name: &amp;quot;Outbound&amp;quot;, count: 1}, {name: &amp;quot;Mudcakes&amp;quot;, count: 2}, {name: &amp;quot;Happy Industries&amp;quot;, count: 2}}&lt;/div&gt;
&lt;div class="FieldLayout---label_column FieldLayout---near"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="FieldLayout---label_column FieldLayout---near"&gt;So the pie chart looks as I wanted to:&lt;/div&gt;
&lt;div class="FieldLayout---label_column FieldLayout---near"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="FieldLayout---label_column FieldLayout---near"&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/16/pastedimage1546515638784v1.png"&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1546515638784v1.png" alt=" " /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="FieldLayout---label_column FieldLayout---near"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="FieldLayout---label_column FieldLayout---near"&gt;Thank you!&lt;/div&gt;
&lt;p class="ParagraphText---richtext_paragraph ParagraphText---default_direction ParagraphText---align_start elements---global_p"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="ParagraphText---richtext_paragraph ParagraphText---default_direction ParagraphText---align_start elements---global_p"&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: issue with reject(fn!isnull, 'array of arrays') function on a data generated from an expression rule</title><link>https://community.appian.com/thread/63769?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 22:09:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8c429ee2-fca5-4cad-8b0a-b7e3caf09f76</guid><dc:creator>Jose Cavazos</dc:creator><description>Hi Manuel,&lt;br /&gt;
&lt;br /&gt;
What i would suggest it may not be the best answer, Have you tried adding key value to the array of elements?&lt;br /&gt;
Find the following example.&lt;br /&gt;
reject(fn!isnull,&lt;br /&gt;
  {&lt;br /&gt;
  {},  {},  {},  {},  {},  {},  {},  {},  {&lt;br /&gt;
   item:&amp;quot;Outbound&amp;quot;,&lt;br /&gt;
   id: 2&lt;br /&gt;
  },  {},  {&lt;br /&gt;
    item:&amp;quot;Mudcakes&amp;quot;,&lt;br /&gt;
   id: 2&lt;br /&gt;
  },  {&lt;br /&gt;
   item:&amp;quot;Industries&amp;quot;,&lt;br /&gt;
   id: 2&lt;br /&gt;
  },  {},  {}&lt;br /&gt;
}&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
This will give you the output you need.&lt;br /&gt;
&lt;br /&gt;
You can even test how the values are getting passed by using the a!foreach()&lt;br /&gt;
So if you do &lt;br /&gt;
a!foreach(&lt;br /&gt;
items: Your array,&lt;br /&gt;
expression: &lt;br /&gt;
fv!item)&lt;br /&gt;
&lt;br /&gt;
This will remove the blanks by default and will give you  {&amp;quot;Outbound&amp;quot;, 1, &amp;quot;Mudcakes&amp;quot;, 2, &amp;quot;Happy Industries&amp;quot;, 2}.&lt;br /&gt;
If you use keypaired values will give your desired output also.&lt;br /&gt;
&lt;br /&gt;
The issue is because it treats them as different elements even if they come within an array of arrays it counts them as separate elements if they don&amp;#39;t come within key paired values. &lt;br /&gt;
&lt;br /&gt;
Hope this helps. I&amp;#39;m sure you can get better suggestions on your problem.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: issue with reject(fn!isnull, 'array of arrays') function on a data generated from an expression rule</title><link>https://community.appian.com/thread/63768?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 21:59:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ba563b72-265a-4e76-b10c-3f3c5cdbb54f</guid><dc:creator>Mike Schmitt</dc:creator><description>It appears that Reject is flattening the resulting array prior to evaluating.  This isn&amp;#39;t much of a surprise to me, since Appian&amp;#39;s ability to handle array-of-arrays in most cases is pretty spotty (and slightly unpredictable).  I would suggest you consider making your expression rule pass back dictionary data instead of {text, integer} arrays, because then you could pretty easily weed out blank/empty entries from your return list without needing to bend over backwards to avoid the array flattening that&amp;#39;s happening here.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>