<?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>Add null to array</title><link>https://community.appian.com/discussions/f/general/27118/add-null-to-array</link><description>Hello Appian People, 
 
 Do you have any idea how to to implement this case: 
 So for example variable arr must be the same length value of variable value: 
 local!arr:{1,2,3} 
 local! value : {&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;} 
 
 But if incase of variable arr is not equal</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Add null to array</title><link>https://community.appian.com/thread/106475?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2023 11:09:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9b245f38-ab2f-436f-8718-28787a32eaa4</guid><dc:creator>prachig0025</dc:creator><description>&lt;p&gt;Hi Richard,&lt;/p&gt;
&lt;p&gt;Yes definitely I&amp;#39;ll use this feature from now. Thank you for this information.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add null to array</title><link>https://community.appian.com/thread/106468?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2023 09:40:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d3743cf4-711c-4018-b6ba-b461ba5a0c83</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;hi prachig, &lt;br /&gt;please use this feature when you inserting code&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1673343664175v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add null to array</title><link>https://community.appian.com/thread/106429?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2023 13:17:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dd613682-edf8-43ef-b5af-618c85c418e4</guid><dc:creator>prachig0025</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can try this solution, this will add null values to the array which has a smaller number of values into it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;a!localVariables(&lt;br /&gt; local!arr: { 1 },&lt;br /&gt; local!value: { 1, 3, 5 },&lt;br /&gt; local!diff: if(&lt;br /&gt; a!isNullOrEmpty(difference(local!arr, local!value)),&lt;br /&gt; difference(local!value, local!arr),&lt;br /&gt; difference(local!arr, local!value)&lt;br /&gt; ),&lt;br /&gt; if(&lt;br /&gt; a!isNullOrEmpty(local!diff),&lt;br /&gt; local!diff,&lt;br /&gt; if(&lt;br /&gt; a!isNullOrEmpty(difference(local!arr, local!value)),&lt;br /&gt; append(&lt;br /&gt; local!arr,&lt;br /&gt; a!forEach(items: local!diff, expression: null())&lt;br /&gt; ),&lt;br /&gt; append(&lt;br /&gt; local!value,&lt;br /&gt; a!forEach(items: local!diff, expression: null())&lt;br /&gt; ),&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add null to array</title><link>https://community.appian.com/thread/106427?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2023 11:07:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6351cb36-e506-4a29-9b0d-d78bc0d12482</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;i would rather ask, if the implementation is 100% fine, if you are required to add null values into your array. Can you let us in the whole story? My feeling is, we should fix the root cause instead of the symptom&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add null to array</title><link>https://community.appian.com/thread/106426?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2023 11:06:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ee584fa2-32ab-4c0f-a413-f21e7eaab780</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;...like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;fn!append(
    local!arr,
    fn!repeat(fn!length(local!value)-length(local!arr), null)
  )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Obviously you&amp;#39;d have&amp;nbsp;check beforehand that local!arr was in fact smaller than local!value but otherwise this should do the trick,...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add null to array</title><link>https://community.appian.com/thread/106425?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2023 11:03:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:24a07678-7bf0-46ac-ac2b-cea4577e490d</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span class="user-name"&gt;&lt;a class="internal-link view-user-profile" href="/members/joselleo9535"&gt;peanut&lt;/a&gt;,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="user-name"&gt;hope this is what you are asking for, this will only display a null value as output but will not add the value to the array.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!arr:{1},
  local!values:{1,2,3},
  {
   a!flatten(
     a!forEach(
       items: local!values,
       expression: {
         index(local!arr,fv!index,null())
       }
     )
   )
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;We can wait for the experts to solve your question!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add null to array</title><link>https://community.appian.com/thread/106424?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2023 11:02:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e06d8ab7-6c64-4e4f-af8f-cb4e6bfef9b1</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;It should just be the case of determine the difference in size of the arrays and adding to the smaller array an enumeration of null values to fill out the difference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>